Skip to content

Commit d7af338

Browse files
committed
fix(devtools): display children with empty parent
Fix posva/unplugin-vue-router#235
1 parent ccbdd52 commit d7af338

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/router/src/devtools.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,13 @@ export function addDevtools(app: App, router: Router, matcher: RouterMatcher) {
266266
const payload = activeRoutesPayload
267267

268268
// children routes will appear as nested
269-
let routes = matcher.getRoutes().filter(route => !route.parent)
269+
let routes = matcher.getRoutes().filter(
270+
route =>
271+
!route.parent ||
272+
// these routes have a parent with no component which will not appear in the view
273+
// therefore we still need to include them
274+
!route.parent.record.components
275+
)
270276

271277
// reset match state to false
272278
routes.forEach(resetMatchStateOnRouteRecord)

0 commit comments

Comments
 (0)