主要应用插件vuex-persistedstate
import Vue from "vue";
import Vuex from "vuex";
import storeSidebar from "./storeSidebar";
import storeConsole from "./storeConsole";
import storeLogin from "./storeLogin";
import storeUrl from "./storeUrl";
import storeUserFliters from "./storeUserFliters";
import storeRoleFliters from "./storeRoleFliters";
import storeUser from "./storeUser";
import storeRole from "./storeRole";
import storeWidget from "./storeWidget";
import storeOrgan from "./storeOrgan";
import storeUserImage from "./storeUserImage";
import CreatePersistedState from "vuex-persistedstate";
Vue.use(Vuex);
export default new Vuex.Store({
state: {},
mutations: {},
actions: {},
modules: {
storeSidebar,
storeConsole,
storeLogin,
storeUrl,
storeUserFliters,
storeUser,
storeWidget,
storeRoleFliters,
storeRole,
storeOrgan,
storeUserImage
},
plugins: [
CreatePersistedState({
reducer(val) {
return {
assessmentData: val.storeLogin,
storeSidebar: val.storeSidebar,
storeUserImage: {
userImage: val.storeUserImage.userImage
},
storeUrl: {
url: val.storeUrl.url,
MenuList: val.storeUrl.MenuList,
RelationList: val.storeUrl.RelationList,
appList: val.storeUrl.appList
}
};
}
})
]
});
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。