From d7af338d9e27e77ac109bf7495e057a2df9a8752 Mon Sep 17 00:00:00 2001 From: Eduardo San Martin Morote Date: Fri, 22 Sep 2023 11:23:54 +0200 Subject: [PATCH] fix(devtools): display children with empty parent Fix posva/unplugin-vue-router#235 --- packages/router/src/devtools.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/router/src/devtools.ts b/packages/router/src/devtools.ts index c135a85b0..81760225b 100644 --- a/packages/router/src/devtools.ts +++ b/packages/router/src/devtools.ts @@ -266,7 +266,13 @@ export function addDevtools(app: App, router: Router, matcher: RouterMatcher) { const payload = activeRoutesPayload // children routes will appear as nested - let routes = matcher.getRoutes().filter(route => !route.parent) + let routes = matcher.getRoutes().filter( + route => + !route.parent || + // these routes have a parent with no component which will not appear in the view + // therefore we still need to include them + !route.parent.record.components + ) // reset match state to false routes.forEach(resetMatchStateOnRouteRecord)