| | |
| | | } |
| | | } |
| | | |
| | | const rootMenu = { routes: [] } |
| | | const rootMenu = { routes: [], children: [] } |
| | | addHomeMenu(remoteMenu); |
| | | addUserSettingMenu(remoteMenu); |
| | | patchRouteItems(rootMenu, remoteMenu); |
| | | console.log(rootMenu); |
| | | |
| | | proLayout.children = proLayout.children.concat(rootMenu.routes); |
| | | proLayout.routes = proLayout.routes.concat(rootMenu.routes); |
| | |
| | | element: <Component />, |
| | | } |
| | | parent.routes.push(newRoute); |
| | | parent.children.push(newRoute); |
| | | } else { |
| | | // parent |
| | | const newRoute = { |
| | |
| | | children: [], |
| | | } |
| | | parent.routes.push(newRoute); |
| | | parent.children.push(newRoute); |
| | | if (menu.routes && menu.routes.length > 0) { |
| | | for (const route of menu.routes) { |
| | | patchRouteItems(newRoute, [route]); |