feat: 路由meta添加activePath可将某个菜单激活,主要用于通过queryparams传参的路由

This commit is contained in:
xiaoxian521
2023-06-13 22:18:23 +08:00
parent 5d86b714a4
commit 58cafbc73f
9 changed files with 135 additions and 110 deletions

View File

@@ -101,7 +101,7 @@ const whiteList = ["/login"];
const { VITE_HIDE_HOME } = import.meta.env;
router.beforeEach((to: toRouteType, _from, next) => {
router.beforeEach((to: ToRouteType, _from, next) => {
if (to.meta?.keepAlive) {
handleAliveRoute(to, "add");
// 页面整体刷新和点击标签页刷新

View File

@@ -256,7 +256,7 @@ function formatTwoStageRoutes(routesList: RouteRecordRaw[]) {
}
/** 处理缓存路由(添加、删除、刷新) */
function handleAliveRoute({ name }: toRouteType, mode?: string) {
function handleAliveRoute({ name }: ToRouteType, mode?: string) {
switch (mode) {
case "add":
usePermissionStoreHook().cacheOperate({