Skip to content

Commit 7e32659

Browse files
committed
refactor(router): use layout for parent handling
1 parent 6f31c33 commit 7e32659

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/features/router/initRouter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export async function initAuthRoutes(addRoutes: (parent: string | null, route: R
5252

5353
function collectParentInfo(routes: Api.Route.BackendRoute[], parent: string | null = null) {
5454
routes.forEach(route => {
55-
const routeParent = route.parent !== undefined ? route.parent : parent;
55+
const routeParent = route.layout !== undefined ? route.layout : parent;
5656
routeParentMap.set(route.name, routeParent ?? null);
5757
});
5858
}

src/service/types/route.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ declare namespace Api {
4040
layout?: string;
4141
/** 路由唯一标识 */
4242
name: string;
43-
/** 父路由标识 */
44-
parent?: string;
4543
/** 路由 path */
4644
path: string;
4745
/** 重定向 */

0 commit comments

Comments
 (0)