Closed mzymta closed 3 years ago
Yes, I think this should exactly like you say. Similar to the automatically generated getters. Did you have any problems with it?
Hi Bodo, so you are saying that in Vue component I can import module instance and do userModule.firstName = value;
to modify the state?
The thing is that it looks like I am directly modifying the state bypassing mutation which contradicts with the Vuex pattern where the state should only be changed inside mutations.
Or I am getting it wrong and userModule.firstName = value;
calls generated mutation on the background?
userModule.firstName = value;
is indeed calling the generated set__firstName
mutation on the background. Super cool!
Thank you!
Is there a way to use auto-generated mutations (with
generateMutationSetters: true
option) from the module instance? In Vue component for example?Or they have to be explicitly defined in this case?