关于vuex的赋值和取值相关问题积累

摘自:https://blog.csdn.net/qq_44469200/article/details/103679882【深刻认识this.$store.dispatch() 与 this.$store.commit()的区别】

commit: 同步操作

this.$store.commit('changeValue',name)

this.$store.state.changeValue

dispatch: 异步操作

this.$store.dispatch('getlists',name)

this.$store.getters.getlists

原文地址:https://www.cnblogs.com/Zhang-jin/p/14148019.html