What is the difference between router-link-active and router-link-exact-active? #2016
-
Reproductionhttps://jsfiddle.net/yoshipy/v7t2nrm5/27/ Steps to reproduce the bugCheck the color of Expected behaviorThe color should be red. This is because, according to the RFC about active matching listing the difference between "router-link-active" and "router-link-exact-active", if the current route is "/parent/1/child/2", then /parent/1 should be active. Actual behaviorThe color is blue Additional informationOr is that RFC outdated? What is the exact difference between router-link-active and router-link-exact-active? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It's because you have duplicated const router = createRouter({
history: createWebHistory(),
routes: [
{ path: '/parent/:id',
component: Home,
children: [
{path: '', component: Foo},
{path: 'child/:id2', component: Bar},
{path: 'child-second/:id2', component: Baz}
] },
],
}) BTW you can check the console for warnings, in this case the router points you to it. |
Beta Was this translation helpful? Give feedback.
It's because you have duplicated
id
(like in the RFC), which is not valid. This works:BTW you can check the console for warnings, in this case the router points you to it.