Vue学习笔记
this.$store.dispatch()和this.$store.commit()的本质是存取方式的不同,两个方法都是传值给vuex的mutation改变statecommit:同步操作存值this.$store.commit(‘state变量/state方法返回的值’,name)取值this.$store.state.changeValuedispatch:异步操作存值this.$store.dispatch(‘state变量/state方法返回的值’,name)取值this.$store.getters.getlistsdemo示例可以查看如下参考文献demo示例参考vuex详解参考文献如下vuex运行原理详解官方详解