fix(projects): the length of routes children list should greater than 0

This commit is contained in:
HuangZheng 2023-02-19 17:04:55 +08:00
parent 960b436c79
commit e1afc10b80

View File

@ -10,7 +10,7 @@ export function transformAuthRouteToMenu(routes: AuthRoute.Route[]): App.GlobalM
const { name, path, meta } = route;
const routeName = name as string;
let menuChildren: App.GlobalMenuOption[] | undefined;
if (route.children) {
if (route.children && route.children.length > 0) {
menuChildren = transformAuthRouteToMenu(route.children);
}
const menuItem: App.GlobalMenuOption = addPartialProps({