We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent efa1472 commit 5388f04Copy full SHA for 5388f04
1 file changed
packages/plugin-qiankun/src/master/masterRuntimePlugin.ts.tpl
@@ -82,10 +82,12 @@ export function patchRoutes(opts: { routes: IRouteProps[] }) {
82
const getRootRoutes = (routes: IRouteProps[]) => {
83
const rootRoute = routes.find(route => route.path === '/');
84
if (rootRoute) {
85
- if (!rootRoute.routes) {
86
- rootRoute.routes = [];
+ // 如果根路由是叶子节点,则直接返回其父节点
+ if (!rootRoute.routes?.length) {
87
+ return routes;
88
}
- return rootRoute.routes;
89
+
90
+ return getRootRoutes(rootRoute.routes);
91
92
93
return routes;
0 commit comments