全局状态vuex
2019-03-22 本文已影响0人
dwy_interesting
核心:
mutations是唯一一个更改state的地方,是同步的
接受的参数是state

actions里装的都是异步方法
接受的参数是整个store


getters

加入购物车时的state处理

核心:
mutations是唯一一个更改state的地方,是同步的
接受的参数是state
actions里装的都是异步方法
接受的参数是整个store
getters
加入购物车时的state处理