Active class not applied on RouterLink
when using to
with string
or object with path
key
#2419
Labels
RouterLink
when using to
with string
or object with path
key
#2419
Reproduction
https://stackblitz.com/edit/vitejs-vite-a1m7gbnq
Steps to reproduce the bug
Go to Feature one
)Expected behavior
The
RouterLink
component with the/features
value is expected to have the active class (router-link-active
) applied when the current route is/features/one
, regardless of how theto
prop value is provided.Actual behavior
The active class (
router-link-active
) is applied only when theto
prop is passed with a routename
. However, for anotherRouterLink
where theto
prop is provided as a string, the active class is not applied.Additional information
There is another difference between these two
RouterLink
components, though I'm not sure if it's a bug:Clicking only on the second link causes the
$route.params
to include apathMatch
key.You can verify this by clicking on the first two links in the reproduction link.
The text was updated successfully, but these errors were encountered: