refactor(projects): 路由文件夹拆分模块,代码重构

This commit is contained in:
Soybean
2021-10-11 17:51:16 +08:00
parent f0474bd961
commit 73505d914f
25 changed files with 2408 additions and 2131 deletions

View 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 };