Vuex至關於一個倉庫,將多個頁面須要用到的數據存儲在倉庫中,方便調用。store store store store異步
在store 中有5個key值,分別爲 state getter mutations actions modules state是存儲靜態數據的狀態,至關於Vue中的data,state數據只能經過store.commit('mutations中的方法名',{payload負載}) ==store。getter至關於Vue中的methods,在裏面寫方法能夠改變state中的值。action能夠說是mutation的補充,action能夠是異步的函數,能夠調用store.commit()來改變mutation的值。modules的做用是將store分紅多個子store,便於管理。函數