2.5.17 & 3.0.1
https://jsfiddle.net/8xrk1n9f/1279/
router.map({
'/foo': {
component: Foo
},
'/bar': {
component: Bar
}
})
router.alias({
'/baz': '/bar'
})
The /baz path is alias of /bar, it should be active when i click /baz link.
nothing happened, but route to component Bar
Any progress on this?
This went under my radar for too long. I will take a look tomorrow
Forgot to give an update. The current mechanism to compare route doesn't properly take into account aliases as it should compare records. There is a workaround to do it in userland but this depends on #2286 being merged
There is a workaround to do it in userland
@posva you mind sharing some example/links ?
It depends on that PR to be merged first
Any progress?
I know it's probably not the most straightforward way to implement it but i have a workaround that might help some people here.
{
{
path: '/',
beforeEnter: (to, from, next) => next('/actual-route'),
},
{
path: '/actual-route',
},
}
This wil redirect your alias to the intended route and setting the linkActivelass when visiting through an alias.
(source: https://github.com/vuejs/vue-router/issues/1191)
Any updates on the PR merge or other fix?
Not clear if the above comment means this is fixed? Just hit it today, really can't use the alias feature without correct link highlighting. When is 4.x planned for release?
Is there any update on planned date for 4.x release?
The release was one month ago.
https://github.com/vuejs/vue-router-next/releases/tag/v4.0.0
That's for Vue 3 though.
Most helpful comment
I know it's probably not the most straightforward way to implement it but i have a workaround that might help some people here.
This wil redirect your alias to the intended route and setting the linkActivelass when visiting through an alias.
(source: https://github.com/vuejs/vue-router/issues/1191)