vue+vuex

引入vuex.js 创建store 语法: state getter mutations vuex中调用 store.commit(mutations中的方法,传输的数据1…数据n) 组件中调用 this.$store.commit(mutations中的方法名) actions 通过操作mutations操作state中的数据 异步请求时 context.commit(‘mutation中的键’
本站公众号
   欢迎关注本站公众号,获取更多信息