perf: theme

This commit is contained in:
xiaoxian521
2021-12-24 10:55:59 +08:00
parent e6b2eefac5
commit 749633e32c
8 changed files with 52 additions and 6 deletions

View File

@@ -89,7 +89,7 @@ router.beforeEach((to: toRouteType, _from, next) => {
});
};
// 未开启标签页缓存,刷新页面重定向到顶级路由(参考标签页操作例子,只针对静态路由)
if (to.meta?.dynamicLevel) {
if (to.meta?.refreshRedirect) {
const routes = router.options.routes;
const { refreshRedirect } = to.meta;
const { name, meta } = findRouteByPath(refreshRedirect, routes);

View File

@@ -2,8 +2,8 @@ import { RouteLocationNormalized } from "vue-router";
export interface toRouteType extends RouteLocationNormalized {
meta: {
keepAlive: boolean;
keepAlive?: boolean;
refreshRedirect: string;
dynamicLevel: string;
dynamicLevel?: string;
};
}