Closed Radiergummi closed 11 months ago
Your repro isn’t using the code sample you are referring to. It’s working as expected given the parameter is repeated across routes rather than be a single route record with children. Are you sure you are not missing something?
Apparently so, although I can't figure out what it is. Sorry for bothering!
Reproduction
https://codesandbox.io/s/nested-views-broken-active-behaviour-yvcshl
Steps to reproduce the bug
Expected behavior
Parent links should be marked as active if a child route is active and they do not have an
exact
prop. I understand this has changed in Vue router 4, but my routes are properly nested.Actual behavior
The parent route never receives an active state. I have tried directly referencing components, reducing the parent component to a router-view, adding route names, redirects, slashes, what have you. This is simply not working as stated in the documentation.
Additional information
I modified the example from the Vue documentation, which used a route parameter in the parent URL, which apparently is working. This has to work without parameters, too, however. In my specific situation, I have the following routes (indentation indicates children):
"/team"
"users"
""
"invite"
":id"
":id/edit"
"groups"
""
"create"
":id"
":id/edit"
For all of these, I'd expect the "/team" navigation item to be active. I created the router configuration as described in the documentation, but it doesn't work.