vuex-module-decorators icon indicating copy to clipboard operation
vuex-module-decorators copied to clipboard

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

Open chenp1204 opened this issue 2 years ago • 1 comments

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

chenp1204 avatar Apr 08 '22 08:04 chenp1204

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

championswimmer avatar Apr 10 '22 07:04 championswimmer