vuex

  • 安装

npm install vuex --save // 如果安装了淘宝镜像,可以使用 cnpm安装

  • 使用
    1.在store目录下建index.jsvuex的安装与使用
    在main.js中引用
    vuex的安装与使用

注意:
1.vue组件中通过this.$store.state.name来使用;
2.mutations--------commit;
3.actions-------dispatch;
3.getters----getters;
详情请见:https://www.cnblogs.com/xihao/p/11420884.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
  • 2022-01-13
  • 2021-04-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2021-10-29
  • 2022-12-23
  • 2022-12-23
  • 2021-09-22
相关资源
相似解决方案