Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/plugin-qiankun/src/master/masterRuntimePlugin.ts.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,12 @@ export function patchRoutes(opts: { routes: IRouteProps[] }) {
const getRootRoutes = (routes: IRouteProps[]) => {
const rootRoute = routes.find(route => route.path === '/');
if (rootRoute) {
if (!rootRoute.routes) {
rootRoute.routes = [];
// 如果根路由是叶子节点,则直接返回其父节点
if (!rootRoute.routes?.length) {
return routes;
}
return rootRoute.routes;

return getRootRoutes(rootRoute.routes);
}

return routes;
Expand Down