vuex-class
Binding helpers for Vuex and vue-class-component
Dependencies
Installation
$ npm install --save vuex-class
$ yarn add vuex-class
Example
import Vue from 'vue'
import Component from 'vue-class-component'
import {
State,
Getter,
Action,
Mutation,
namespace
} from 'vuex-class'
const someModule = namespace('path/to/module')
@Component
export class MyComp extends Vue {
@State('foo') stateFoo
@State(state => state.bar) stateBar
@Getter('foo') getterFoo
@Action('foo') actionFoo
@Mutation('foo') mutationFoo
@someModule.Getter('foo') moduleGetterFoo
@State foo
@Getter bar
@Action baz
@Mutation qux
created () {
this.stateFoo
this.stateBar
this.getterFoo
this.actionFoo({ value: true })
this.mutationFoo({ value: true })
this.moduleGetterFoo
}
}
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.
License
MIT