mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
refactor(projects): 路由文件夹拆分模块,代码重构
This commit is contained in:
15
src/utils/router/index.ts
Normal file
15
src/utils/router/index.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import type { Component } from 'vue';
|
||||
import { EnumRoutePath } from '@/enum';
|
||||
import type { RoutePathKey } from '@/interface';
|
||||
|
||||
/** 获取路由name map */
|
||||
export function getRouteNameMap() {
|
||||
return new Map<RoutePathKey, RoutePathKey>((Object.keys(EnumRoutePath) as RoutePathKey[]).map(v => [v, v]));
|
||||
}
|
||||
|
||||
/** 给需要缓存的页面组件设置名称 */
|
||||
export function setRouterCacheName(component: Component, name?: string) {
|
||||
if (name) {
|
||||
Object.assign(component, { name });
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user