摘要:
直接通过$store.commit调用 <button @click="$store.commit('mutations中的方法名','可带参数')">调用</button> 不需要再进行其他配置 通过在methods中注册方法调用 //先引入mapMutations import {mapMuta 阅读全文
posted @ 2020-04-19 15:47
程序员徐小白
阅读(4776)
评论(0)
推荐(0)
摘要:
store.js import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) const state = { count: 1 } export default new Vuex.Store({ state,mutations }) 直接通 阅读全文
posted @ 2020-04-19 15:04
程序员徐小白
阅读(2005)
评论(1)
推荐(0)
摘要:
首先先创建一个store.js 安装vue,vuex什么的就不说了 这是一个仓库 import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) //装载数据的一个仓库 const state = { count: 1 } //修改仓库的方法 阅读全文
posted @ 2020-04-19 00:31
程序员徐小白
阅读(66)
评论(0)
推荐(0)

浙公网安备 33010602011771号