使用
const store = new Vuex.Store({
modules: {
user: {},
},
getters,
actions, // 异步
mutations, // 同步
plugins: [createPersistedState({
// storage:window.sessionStorage,
}
)],
})
多 modules 版本
const store = new Vuex.Store({
modules: {
user: {},
menu: [],
},
getters,
actions, // 异步
mutations, // 同步
plugins: [createPersistedState({ })],
})
标签:Vuex,modules,mutations,actions,plugins,persistedstate,vuex,Store
From: https://www.cnblogs.com/IT-IOS-MAN/p/16891361.html