Browse Source

chore: 菜单没有显示的子项无法渲染的问题

(cherry picked from commit b752f3ca8ac9a2adb1407d2ce0fb417ff259755e)
main
李朋徽 1 year ago
parent
commit
de06fd237d
  1. 4
      src/router/helper/routeHelper.ts

4
src/router/helper/routeHelper.ts

@ -82,9 +82,11 @@ export function transformObjToRoute(menuList: MenuItem[]): AppRouteModule[] {
const routeList: AppRouteModule[] = []
menuList.forEach((item) => {
const route = { ...item } as unknown as AppRouteModule
const flag = (route.children || []).every(item => item.visible)
if (isHttpUrl(route.path))
route.component = 'IFrame'
else if (route.children && route.children.length && route.parentId === '0')
else if (route.children && route.children.length && route.parentId === '0' && flag)
route.component = 'LAYOUT'
else if (!route.children)
route.component = route.component as string

Loading…
Cancel
Save