-
Notifications
You must be signed in to change notification settings - Fork 433
vue-class-component breaks correct functioning of Vue.Extend #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I created a github repo demonstrating the problem. |
You can do like this below. @Component
class Hello extends Vue {}
const vm = new Hello()
vm.$mount() |
Hi,
|
declare module '*vue' {
import Vue = require('vue')
export default Vue
} |
Thanks a lot. That makes sense. |
For some (possibly related) reason I can't use components defined in .ts files, only in .vue files. When I import a .vue file (using the shim you provided and the component below) I get a VueConstructor<> which works in the components section. But if I change the extension to .ts I get a "typeof" and it can't determine how to "new" it. @component({ import Hello from "./Hello.vue"; // .vue file works let app = new Vue({ |
First of all, thanks a lot for vue-class-component. It's indispensable for serious vuejs work with ts.
I'm starting from the startup sample of vue with the webpack template, which has an Hello Component with a unit test on this Hello component. So just the standard stuff. I'm using typescript.
Inside the standard unit test the vm is setup as follows
When I transform now the Hello.vue component in such a way I use vue-class-component, the test will BREAK.
I can only get the test working again by changing the way Vue.extend is used:
I'm trying to understand what's going on here.
Thanks a lot for shedding a light on this.
The text was updated successfully, but these errors were encountered: