mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-26 06:40:17 +08:00
16 lines
484 B
TypeScript
16 lines
484 B
TypeScript
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 setCacheName(component: Component, name?: string) {
|
|
if (name) {
|
|
Object.assign(component, { name });
|
|
}
|
|
}
|