namespaced:true使用
使用模块中的mutations,getters,actions时候,要加上模块名,例如使用commint执行mutations时
格式:模块名/模块中的mutations
xxx/setUserInfo
this.$store.commit("userInfo/setUserInfo",userInfo)
获取属性时同时加上模块名
格式:$store.state.userinfo.username
namespaced:true使用
使用模块中的mutations,getters,actions时候,要加上模块名,例如使用commint执行mutations时
格式:模块名/模块中的mutations
xxx/setUserInfo
this.$store.commit("userInfo/setUserInfo",userInfo)
获取属性时同时加上模块名
格式:$store.state.userinfo.username