Vuex 使用了 module 后的访问方法 ..
生活随笔
收集整理的这篇文章主要介绍了
Vuex 使用了 module 后的访问方法 ..
小编觉得挺不错的,现在分享给大家,帮大家做个参考.
如果 使用了 module 和 namespace
state 数据:=> this.$store.state.User.info (user 是模块名字. info 是 state 里面的属性名字)
getters 数据: => this.$store.getters['User/getUserInfo'] (user namespace,模块名, getUserInfo 是 getter 的名字)
mutations => this.$store.commit( 'AppKeepAlive/remove', name); (AppKeepAlive 模块名, remove方法名, name 是荷载数据 payload)
转载于:https://www.cnblogs.com/whm-blog/p/10089157.html
总结
以上是生活随笔为你收集整理的Vuex 使用了 module 后的访问方法 ..的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇: 第二次博客作业
- 下一篇: vue中如何使用mockjs摸拟接口的各