vuex的命名空间

文档有介绍 https://vuex.vuejs.org/zh-cn/modules.html

操作方法:
namespaced: true 的方式使其成为带命名空间的模块

export default {
  namespaced: true,  
  state,
  getters,
  actions,
  mutations,
};

页面调用方法:

this.$store.dispatch('xxxx/fetchList');

猜你喜欢

转载自blog.csdn.net/zhooson/article/details/80108449