vuex使用
vuex是状态管理模式
import Vue from 'vue';
import Vuex from 'vuex';
// Make sure to call Vue.use(Vuex) first if using a module system
Vue.use(Vuex);
const store = new Vuex.Store({
state: {
count: 0
},
mutations: {
increment (state) {
state.count++
}
}
})

浙公网安备 33010602011771号