: www.jianshu.com/p/eb23c72ab…

Now summarize the use method:

import Vue from 'vue' import Vuex from 'vuex' Vue.use(Vuex) export default new Vuex.Store({ state: {// open mutations: demoValue:{}}, mutations: SetDemoValue (state,demoValue){state. DemoValue = demoValue}}, getters: {//get method getDemoValue: State => state. DemoValue}, actions: {// modules: {//Copy the code

When used, the get and set methods are:

this.$store.commit('setDemoValue', value); This. / / set the global variable $store. Getters. GetDemoValue; // Get global variablesCopy the code

Unfinished, continue to add later