Skip to content

Commit

Permalink
fix(devtools): display children with empty parent
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Sep 22, 2023
1 parent ccbdd52 commit d7af338
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/router/src/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d7af338

Please sign in to comment.