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,便于管理。函数