import{getStore, setStore}from'@/util/store'const wel ={state:{id:getStore({name:'id'})||0,},mutations:{SET_ID:(state, id)=>{
state.id = id
setStore({name:'id',content: state.id})}},actions:{},};exportdefault wel
store.index.js
import Vue from'vue'import Vuex from'vuex'import wel from'./modules/wel'import getters from'./getters'
Vue.use(Vuex);const store =newVuex.Store({modules:{
wel
},
getters
});exportdefault store