摘要:
mutation 作用: 更改state的状态 说明: 每个mutation对象都有字符串类型(type)与回调函数,在回调函数内进行状态修改,回调函数的第一个参数为state eg: 调用方式: 1.载荷风格 this.$store.commit('changeMainOption', 1) // 阅读全文
posted @ 2018-05-09 17:43
探索之路慢慢
阅读(314)
评论(0)
推荐(0)
摘要:
1. 在store中分别注册mutation和action,action中用commit同步调用mutation来执行修改state,但是在组件中则使用dispatch异步调用action 2. 通俗来讲,vuex是设计出来核心业务是通信。 其中state为全局的数据源,支持多组件双向绑定。 想要在 阅读全文
posted @ 2018-05-09 15:40
探索之路慢慢
阅读(1059)
评论(0)
推荐(0)

浙公网安备 33010602011771号