From: Eduardo San Martin Morote Date: Fri, 22 Sep 2023 09:23:54 +0000 (+0200) Subject: fix(devtools): display children with empty parent X-Git-Tag: v4.2.5~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7af338d9e27e77ac109bf7495e057a2df9a8752;p=thirdparty%2Fvuejs%2Frouter.git fix(devtools): display children with empty parent Fix posva/unplugin-vue-router#235 --- diff --git a/packages/router/src/devtools.ts b/packages/router/src/devtools.ts index c135a85b..81760225 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)