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

View File

@@ -1,9 +1,16 @@
import type { Router, RouteLocationNormalizedLoaded } from 'vue-router';
import { defineStore } from 'pinia';
import { useRouterPush } from '@/composables';
import { getTabRoutes, clearTabRoutes } from '@/utils';
import { useThemeStore } from '../theme';
import { getTabRouteByVueRoute, isInTabRoutes, getIndexInTabRoutes, getIndexInTabRoutesByRouteName } from './helpers';
import {
getTabRouteByVueRoute,
isInTabRoutes,
getIndexInTabRoutes,
getIndexInTabRoutesByRouteName,
setTabRoutes,
getTabRoutes,
clearTabRoutes
} from './helpers';
interface TabState {
/** 多页签数据 */
@@ -43,6 +50,10 @@ export const useTabStore = defineStore('tab-store', {
clearTabRoutes();
this.$reset();
},
/** 缓存页签路由数据 */
cacheTabRoutes() {
setTabRoutes(this.tabs);
},
/**
* 设置当前路由对应的页签为激活状态
* @param fullPath - 路由fullPath