mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-12-26 15:00:16 +08:00
refactor(projects): 路由文件夹拆分模块,代码重构
This commit is contained in:
19
src/router/helpers/index.ts
Normal file
19
src/router/helpers/index.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { Component } from 'vue';
|
||||
import { getLoginModuleRegExp, getRouteNameMap } from '@/utils';
|
||||
import getCacheRoutes from './cache';
|
||||
import transformRouteToMenu from './menus';
|
||||
|
||||
/** 给需要缓存的页面组件设置名称 */
|
||||
export function setCacheName(component: Component, name?: string) {
|
||||
if (name) {
|
||||
Object.assign(component, { name });
|
||||
}
|
||||
}
|
||||
|
||||
/** 路由name map */
|
||||
export const RouteNameMap = getRouteNameMap();
|
||||
|
||||
/** 登录模块的正则字符串 */
|
||||
export const loginModuleRegExp = getLoginModuleRegExp();
|
||||
|
||||
export { getCacheRoutes, transformRouteToMenu };
|
||||
Reference in New Issue
Block a user