championswimmer / vuex-module-decorators

TypeScript/ES7 Decorators to create Vuex modules declaratively
https://championswimmer.in/vuex-module-decorators/
MIT License
1.8k stars 170 forks source link

In @Mutation, how to call another Mutation, this.xxx is undefined #405

Open chenp1204 opened 2 years ago

chenp1204 commented 2 years ago

My environment vue 2.6.13 vuex 3.6.0 vuex-module-decorators 2.0.0

Hi, @championswimmer ,

@Module({ dynamic: true, namespaced: true, name: 'editor', store, }) class EditorModule extends VuexModule { }

image

i want to call another Mutation in a Mutation, but this.deleteComponent and this.addComponent is undefined, i found this only has properties but no Mutation functions and this.context also undefined

championswimmer commented 2 years ago

You should not need to call one mutation from other as you have this. available directly to you.