提交代码
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* @Author: zwq
|
||||
* @Date: 2023-01-04 10:29:39
|
||||
* @LastEditors: zwq
|
||||
* @LastEditTime: 2023-01-05 15:52:02
|
||||
* @LastEditors: zhp
|
||||
* @LastEditTime: 2023-03-20 16:37:21
|
||||
* @Description:
|
||||
*/
|
||||
import Vue from 'vue'
|
||||
@@ -43,7 +43,7 @@ export const moduleRoutes = {
|
||||
]
|
||||
}
|
||||
|
||||
export function addDynamicRoute (routeParams, router) {
|
||||
export function addDynamicRoute(routeParams, router) {
|
||||
// 组装路由名称, 并判断是否已添加, 如是: 则直接跳转
|
||||
var routeName = routeParams.routeName
|
||||
var dynamicRoute = window.SITE_CONFIG['dynamicRoutes'].filter(item => item.name === routeName)[0]
|
||||
@@ -132,6 +132,7 @@ function fnAddDynamicMenuRoutes (menuList = [], routes = []) {
|
||||
var temp = []
|
||||
for (var i = 0; i < menuList.length; i++) {
|
||||
if (menuList[i].children && menuList[i].children.length >= 1) {
|
||||
console.log(menuList[i].children);
|
||||
temp = temp.concat(menuList[i].children)
|
||||
continue
|
||||
}
|
||||
@@ -143,7 +144,7 @@ function fnAddDynamicMenuRoutes (menuList = [], routes = []) {
|
||||
meta: {
|
||||
...window.SITE_CONFIG['contentTabDefault'],
|
||||
menuId: menuList[i].id,
|
||||
title: menuList[i].name
|
||||
title: menuList[i].name,
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line
|
||||
@@ -157,6 +158,7 @@ function fnAddDynamicMenuRoutes (menuList = [], routes = []) {
|
||||
route['component'] = () => import(`@/views/modules/${URL}`)
|
||||
}
|
||||
routes.push(route)
|
||||
// console.log(route);
|
||||
}
|
||||
if (temp.length >= 1) {
|
||||
return fnAddDynamicMenuRoutes(temp, routes)
|
||||
|
||||
Reference in New Issue
Block a user