vuejs / router

🚦 The official router for Vue.js
https://router.vuejs.org/
MIT License
3.95k stars 1.19k forks source link

When child route path is "" , route.matched not meet expectations #2366

Closed chenxiaoleizi closed 2 months ago

chenxiaoleizi commented 2 months ago

Reproduction

https://codesandbox.io/p/sandbox/nested-views-vue-router-4-examples-forked-66dmz9

Steps to reproduce the bug

  1. Nested routes
  2. Set child route path ""
  3. Console the route.matched Live example

Expected behavior

The route.matched second route path should be "".

Actual behavior

The route.matched second route path is "users".

Additional information

sandbox

posva commented 2 months ago

matched contain normalized route records. It’s normal for it to be different.