补发vuex中的模块化应用modules
作用:方便维护管理
给每个模块取上名字,其里面有基础的4个属性.state,getters,mutations,actions.
1.普通用法:state和mutation需要用其数据就需要$store.state.a模块.数据name,mutation同理.
而getters与actions在用的时候注意不是$store.getter.a模块.数据name而是a模块/数据name
2.映射用法:当用mapstate,mapmutation,…剩下2map方法时候.需要在模块中运用namespaced=true.之后…mapState(模块名,{})进行获取数据