欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 前端技术 > vue >内容正文

vue

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

发布时间:2025/7/14 vue 57 豆豆
生活随笔 收集整理的这篇文章主要介绍了 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 后的访问方法 ..的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。