This commit is contained in:
2025-03-10 19:01:21 +08:00
parent 94644d0601
commit 31a2667f8b
28 changed files with 1370 additions and 57 deletions

View File

@@ -0,0 +1,15 @@
import routesMap from "./routes-map.js";
const generateRouter = (routes) => {
return routes.map(v => ({
path: v.path,
name: v.name,
component: routesMap[v.component],
children: v.children && v.children.length > 0 && [
{path: '', redirect: `/home/${v.name}/${v.children[0].name}`},
...generateRouter(v.children)
],
}))
}
export default generateRouter;