mirror of
https://github.com/pure-admin/pure-admin-thin.git
synced 2025-11-26 04:23:40 +08:00
perf: 同步完整版分支代码
This commit is contained in:
25
src/router/modules/index.ts
Normal file
25
src/router/modules/index.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
// 静态路由
|
||||
import homeRouter from "./home";
|
||||
import errorRouter from "./error";
|
||||
import externalLink from "./externalLink";
|
||||
import remainingRouter from "./remaining";
|
||||
import { RouteRecordRaw, RouteComponent } from "vue-router";
|
||||
|
||||
import {
|
||||
ascending,
|
||||
formatTwoStageRoutes,
|
||||
formatFlatteningRoutes
|
||||
} from "../utils";
|
||||
|
||||
// 原始静态路由(未做任何处理)
|
||||
const routes = [homeRouter, errorRouter, externalLink];
|
||||
|
||||
// 导出处理后的静态路由(三级及以上的路由全部拍成二级)
|
||||
export const constantRoutes: Array<RouteRecordRaw> = formatTwoStageRoutes(
|
||||
formatFlatteningRoutes(ascending(routes))
|
||||
);
|
||||
|
||||
// 用于渲染菜单,保持原始层级
|
||||
export const constantMenus: Array<RouteComponent> = ascending(routes).concat(
|
||||
...remainingRouter
|
||||
);
|
||||
Reference in New Issue
Block a user