Vuex 辅助函数实践

Vuex 辅助函数实践
vkrainVuex 辅助函数实践
0、初始化
1 | const app = new Vue({ |
1、添加vuex加载器
1 | import {mapState,mapActions,mapMutations} from "vuex" |
2、在computed使用state变量,对应的模块
1 | computed: mapState({ |
3、在methods中加载对应的方法名,类型【数组】
1 | methods: { |
0、初始化
1 | const app = new Vue({ |
1、添加vuex加载器
1 | import {mapState,mapActions,mapMutations} from "vuex" |
2、在computed使用state变量,对应的模块
1 | computed: mapState({ |
3、在methods中加载对应的方法名,类型【数组】
1 | methods: { |