摘要:
通过mutations修改state状态 mutations中的方法必须是同步方法 this.$store.commit('mutations中的方法') const store = new Vuex.Store({ state: { counter: 100 }, mutations: { //方 阅读全文
posted @ 2022-11-25 17:42
iTao0128
阅读(44)
评论(0)
推荐(0)
摘要:
安装 npm install vuex --save 创建store文件夹及index.js文件 import Vue from 'vue' import Vuex from 'vuex' //1.安装插件 Vue.use(Vuex) //2.创建对象 const store = new Vuex. 阅读全文
posted @ 2022-11-25 15:52
iTao0128
阅读(42)
评论(0)
推荐(0)

浙公网安备 33010602011771号