Vuex module的那些事(必须打开命名空间,namespaced: true,否则会抛异常)
// 触发module中的state
...mapState("", []) // 方式一
...mapState({
xxx: state => state.xxx.xxx
})
// 触发module中的action
...mapAction("xxx", ['xxx'])
...mapAction({
"xxx": "xxx/xxx"
})
// 触发module中的state
...mapState("", []) // 方式一
...mapState({
xxx: state => state.xxx.xxx
})
// 触发module中的action
...mapAction("xxx", ['xxx'])
...mapAction({
"xxx": "xxx/xxx"
})