I have 2 routes like:
{ path: '/gallery', component: require('components/A') },
{ path: '/gallery/:id', component: require('components/B') },
when user go /gallery/:id from outside, it will render component B
but when user go form my webside(like /gallery -> /gallery/:id)
I want change url but render component in lightbox component not router-view
I use like below now
{
path: '/gallery/:id',
component: require('components/B'),
beforeEnter: (to, from, next) => {
if (from.matched.length) {
history.pushState({}, null, to.path)
} else {
next()
}
}
}
is it possible change url but dont render component by vue-router ?
just like backbone router trigger in router-link, router.push & router.replace
Thx
https://router.vuejs.org/en/essentials/navigation.html
router.replace(location) should work, doesn't it?
It does not...
router.replace just like push...but replace history
it will render component in render-view
Thx
Appears to be duplicate of https://github.com/vuejs/vue-router/issues/703, please reopen if I'm wrong.
Most helpful comment
It does not...
router.replace just like push...but replace history
it will render component in render-view
Thx