-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
Modules inheritance #125
Comments
I have been trying to figure out inheritance myself since I am starting to have a lot of virtually identical modules and I need to move a lot of functions to a higher level abstract class. It doesn't seem to be possible :( |
Same issue here. Inheritance works, but sometimes it does'nt. |
I can confirm this, inheritance is broken, also for getters and attributes. |
@seflue well, it's possible to fix, I have library for Vuex decorators with ability to inherit state, getters, mutations and actions. But now it's in closed repo, so I can't share right now, unfortunately. I haven't been coding with vue for about half year, so maybe no progress there for a while. |
Not much value in this lib if inheritance is broken. Pull request with fix is coming up on 2 years old. Alternative: https://vuejsdevelopers.com/2020/10/05/composition-api-vuex/ |
When I try to extend module B from module A, I get state of A
In this case
Collection
is abstract class for another modules. AndOwner
will have url/collection
, that is not correctSo, I discovered deeper and figured out this line doesn't not call:
vuex-module-decorators/src/module/index.ts
Line 18 in a57bb0c
Because parent already have state.
Therefore i removed
@Module
notation fromCollection
class and it works as expected.But! What if I need to inherit module from another module?
The text was updated successfully, but these errors were encountered: