You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2025. It is now read-only.
importVuefrom'vue'importComponentfrom'vue-class-component'import{State,Getter,Action,Mutation,namespace}from'vuex-class'constsomeModule=namespace('path/to/module')
@ComponentexportclassMyCompextendsVue{
@State('foo')stateFoo
@State(state=>state.bar)stateBar
@Getter('foo')getterFoo
@Action('foo')actionFoo
@Mutation('foo')mutationFoo
@someModule.Getter('foo')moduleGetterFoo// If the argument is omitted, use the property name// for each state/getter/action/mutation type
@Statefoo
@Getterbar
@Actionbaz
@Mutationquxcreated(){this.stateFoo// -> store.state.foothis.stateBar// -> store.state.barthis.getterFoo// -> store.getters.foothis.actionFoo({value: true})// -> store.dispatch('foo', { value: true })this.mutationFoo({value: true})// -> store.commit('foo', { value: true })this.moduleGetterFoo// -> store.getters['path/to/module/foo']}}
Issue Reporting Guideline
Questions
For general usage question which is not related to vuex-class should be posted to StackOverflow or other Q&A forum. Such questions will be closed without an answer.
Bug Reports
Please make sure to provide minimal and self-contained reproduction when you report a bug. Otherwise the issue will be closed immediately.