Closed xEsk closed 2 years ago
If you are never going to instantiate the View.vue
class then you can convert it to a normal View.ts
class and then import it as usual:
@xjrcode It works now, thank you.
What if the vue component you are extending contains an HTML template and some CSS. How can that become a .ts file instead? I guess I will just have to refactor the code to split out the script.
Any body , has a solution ?
In my situation my base component never have HTML or CSS so using the .ts extension instead of .vue do the trick.
Version
3.2.31
Reproduction link
stackblitz.com
Steps to reproduce
Just run the repo in dev mode.
Steps which I used
What is expected?
A console message saying "Hell-o" and the default Vue welcome screen.
What is actually happening?
Throws an exception:
Uncaught TypeError: Class extends value #\<Object> is not a constructor or null
When you build the project, the dist version works like expected (with no errors) and displaying the console message, it only fails on dev mode.
I used this in previous projects, and now it is not working anymore...