Files
certd/packages/ui/certd-client/src/router/source/framework.ts
xiaojunnuo be1b6f8edc chore:
2025-04-10 13:30:56 +08:00

43 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import LayoutBasic from "/@/layout/layout-basic.vue";
import type { RouteRecordRaw } from "vue-router";
import { mergeRouteModules } from "/@/vben/utils";
const dynamicRouteFiles = import.meta.glob("./modules/**/*.ts*", {
eager: true,
});
/** 动态路由 */
const dynamicRoutes: RouteRecordRaw[] = mergeRouteModules(dynamicRouteFiles);
export const frameworkResource = [
{
title: "框架",
name: "root",
path: "/",
redirect: "/index",
component: LayoutBasic,
meta: {
icon: "ion:accessibility",
hideInBreadcrumb: true,
},
children: [
{
title: "首页",
name: "index",
path: "/index",
component: "/framework/home/index.vue",
meta: {
fixedAside: true,
showOnHeader: false,
icon: "ion:home-outline",
auth: true,
},
},
// @ts-ignore
...dynamicRoutes,
],
},
];
console.assert(frameworkResource.length === 1, "frameworkResource数组长度只能为1你只能配置framework路由的子路由");