feat(projects): 添加生产的主题配置缓存

This commit is contained in:
Soybean
2022-06-20 23:23:55 +08:00
parent 5c1b086cb4
commit 718c36263e
16 changed files with 137 additions and 48 deletions

14
src/composables/events.ts Normal file
View File

@@ -0,0 +1,14 @@
import { useEventListener } from '@vueuse/core';
import { useThemeStore, useTabStore } from '@/store';
/** 全局事件 */
export function useGlobalEvents() {
const theme = useThemeStore();
const tab = useTabStore();
/** 页面离开时缓存多页签数据 */
useEventListener(window, 'beforeunload', () => {
theme.cacheThemeSettings();
tab.cacheTabRoutes();
});
}

View File

@@ -1,4 +1,5 @@
export * from './system';
export * from './router';
export * from './layout';
export * from './events';
export * from './echarts';