From 61f4176dba410d5bdf0174068f54cb60b980c488 Mon Sep 17 00:00:00 2001 From: heshunme Date: Tue, 2 Jul 2024 00:33:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B1=80=E6=9B=B4=E6=96=B0=E4=BA=86lo?= =?UTF-8?q?calStorage=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/store/index.js b/src/store/index.js index 6202026..ef842c6 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,10 +1,11 @@ -import { createStore } from 'vuex' +import {createStore} from 'vuex' import authentication from './authentication' import courseManagement from './courseManagement' import meetingManagement from './meetingManagement' import newsManagement from './newsManagement' import organizationManagement from './organizationManagement' import userManagement from './userManagement' +import createPersistedState from "vuex-persistedstate"; // 请不要直接修改本文件,使用修改/store目录下的对应模块名称的js的方式来代替-> @@ -16,7 +17,13 @@ const store = createStore({ newsManagement, organizationManagement, userManagement - } + }, + + plugins: [ + createPersistedState({ + storage: window.localStorage, + }), + ] }) export default store