mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-09 13:53:38 +08:00
fix(tag): 修复关闭左侧/右侧标签页时未删除缓存路由问题 (#66)
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
createWebHashHistory,
|
||||
RouteRecordNormalized
|
||||
} from "vue-router";
|
||||
import { RouteConfigs } from "/@/layout/types";
|
||||
import { split, uniqBy } from "lodash-es";
|
||||
import { i18n } from "/@/plugins/i18n";
|
||||
import { openLink } from "/@/utils/link";
|
||||
@@ -74,6 +75,16 @@ export const getAliveRoute = () => {
|
||||
return alivePageList;
|
||||
};
|
||||
|
||||
// 批量删除缓存路由
|
||||
export const delAliveRoutes = (delAliveRouteList: Array<RouteConfigs>) => {
|
||||
delAliveRouteList.forEach(route => {
|
||||
usePermissionStoreHook().cacheOperate({
|
||||
mode: "delete",
|
||||
name: route?.name
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// 处理缓存路由(添加、删除、刷新)
|
||||
export const handleAliveRoute = (
|
||||
matched: RouteRecordNormalized[],
|
||||
|
||||
Reference in New Issue
Block a user