vuex-declaration
v0.0.1-fixed
Published
Declare state like props, make state inject to vuex dynamically when component created.
Downloads
3
Readme
Vuex Declaration
Declare state like props, make state inject to vuex dynamically when component created.
Usage
npm i vuex-declaration
import vuecDeclaration from 'vuex-declaration'
import Vue from 'vue'
Vue.use( vuexDeclaration );
Vue.component( 'self-component', {
data () { ... },
props : [ ... ],
created () { ... },
state : [ 'state-a', 'state-b' ],
} )
export default {
state : {
'state-a' : {
module : 'module-a',
}
}
}