-
Notifications
You must be signed in to change notification settings - Fork 433
Mixin and @Watch won't watch #119
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
debugging now:
|
I think the issue is in https://github.com/vuejs/vue-class-component/blob/master/src/component.ts the decorators aren't called for all the decorators |
I think this is #104 Unfortunately npm5 is buggy, as I was under the impression that I was using the latest version, but currently 4.4. is installed. Can't get npm update working atm. |
case closed until I have proper tested with 5.0.2 |
unfortunately this is also an issue with 5.0.2 :( |
Could you provide self-contained reproduction with github repo or jsfiddle? |
@304NotModified sorry , my fault. https://github.com/vuejs/vue-class-component/blob/master/src/index.ts
but Mixin need a wrap to contain the mixined interface
So I implement the Component again ,add type support for VClass and name it ComponentForMixin , maybe the componentFactory method will check whether it is instance of official Component . I just use the official Component and test again,it has a ts type error,but it can works now. @HerringtonDarkholme |
I am also a fresh for TypeScript , look like there is a way to extend a namespace out . @ktsn |
@304NotModified
there are both not a grace way , maybe the first is acceptable . in fact , this type error has not real effect . I will keep thinking and learning ... |
Hi @JsonSong89 thanks But unfortunately the issue why on my side. I had a dependency hell with NPM. I found out I had 2 times vue-class-component in node_modules (5.0.2), one at top level and one at node_modules/vue-property-decorator/node_modules/ (5.0.1) In my package.json both packages where listed only once:
This was caused by package-lock.json, and I don't now why. It had this in the lock file: I removed the npm lock file, removed the node_modules folder and after npm install it worked. Thanks for the support, sorry for the inconvenience. Concluding: fixed in 5.0.2 with #104 |
It seems that the
@Watch
isn't working when using mixins as described in #91.The @watch works in the mixin, but not in the class that is using the mixin.
In the following example:
test1
workstest2
wont work. Is the the property is reactive, but it's not listed in_watchers
and not in_computedWatchers
.Is there something I could do to fix this? It's a showstopper for me for using Mixins. Thanks in advance!
@JsonSong89 any idea?
NB the
@Watch
is from vue-property-decoratorThe text was updated successfully, but these errors were encountered: