Vue2-vuex

来源:


语法

  • state 用于存储数据
  • mutations 用户存改变state的方法
  • 暴露变量:
    const store = new Vuex.Store({
        state,
        mutations
    });
    
  • 注册到实例
    this.$store.
    this.$store.commit();
    
posted @ 2021-05-27 14:06  oxy-blogs  阅读(27)  评论(0编辑  收藏  举报