commit:同步操作 存储 this.$store.commit(‘changeValue’,name) 取值 this.$store.state.changeValue dispatch:异步操作 存储 this.$store.dispatch(‘loginValue’,name) 取值 this.$store.getters.loginValue 总结:两者只是存取方式不同,两个都是传值给vuex的mutation改变state