首页 > 其他 > 详细

Vuex 使用了 module 后的访问方法 ..

时间:2018-12-08 21:35:26      阅读:251      评论:0      收藏:0      [点我收藏+]

如果 使用了  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)

 技术分享图片

 

Vuex 使用了 module 后的访问方法 ..

原文:https://www.cnblogs.com/whm-blog/p/10089157.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!