mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
feat: 路由meta添加activePath可将某个菜单激活,主要用于通过query或params传参的路由
This commit is contained in:
@@ -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");
|
||||
// 页面整体刷新和点击标签页刷新
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user