|
|
@@ -49,11 +49,7 @@ async function beforeAddRoutes() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- console.log(homeRouter.value)
|
|
|
router.addRoute(homeRouter.value)
|
|
|
- // routers.forEach(item => {
|
|
|
- // router.addRoute(item)
|
|
|
- // })
|
|
|
}
|
|
|
|
|
|
function createNameComponent(item) {
|
|
|
@@ -103,39 +99,6 @@ const capitalizeFirstLower = (word: string) => {
|
|
|
return word.charAt(0).toLowerCase() + word.slice(1);
|
|
|
}
|
|
|
|
|
|
-// function addRoutes(menus: IntergrationMenu[]) {
|
|
|
-// const routers: RouteRecordRaw[] = []
|
|
|
-// menus.forEach(item => {
|
|
|
-// const meta: { [key: string]: any } = {}
|
|
|
-// for (let key in item) {
|
|
|
-// if (key.startsWith("meta")) {
|
|
|
-// const metaKey = capitalizeFirstLower(key.replace("meta", ""))
|
|
|
-// meta[metaKey] = item[key]
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// let path = item.path
|
|
|
-// if (item.pathParams?.length > 0) {
|
|
|
-// const paths = item.path.split("/$")
|
|
|
-// path = paths[0]
|
|
|
-// }
|
|
|
-//
|
|
|
-// const data: RouteRecordRaw = {
|
|
|
-// path: path + item.pathParams,
|
|
|
-// name: item.name,
|
|
|
-// redirect: item.redirect,
|
|
|
-// meta: meta,
|
|
|
-// component: createNameComponent(item)
|
|
|
-// };
|
|
|
-// if (item.children && item.children.length > 0) {
|
|
|
-// data.children = addRoutes(item.children)
|
|
|
-// }
|
|
|
-// routers.push(data)
|
|
|
-// })
|
|
|
-// return routers
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
const finalRouters: IntergrationMenu[] = ref([])
|
|
|
|
|
|
function addRoutes(parentPath: string, menus: IntergrationMenu[]) {
|