I'm working on a 404 page, it works fine, I have the following:
const router = new VueRouter({
routes: [
// ...
{
path: '*',
component: NotFound,
name: '404',
meta: {page_title: '404 NOT FOUND'}
},
]
});
// ... alguma coisa 'not found'
this.$router.push({name: '404'});
The problem with this is that the URL changes as well, but I just want the view / component to change, and the URL stays the same.
I find it very annoying to be redirected to link , if I fool myself into anything I have to write the whole url or go through the browser autofill , anyway I do not like it.
I was wondering if there is any method / logic so you can have something like link .
In short, I want the view / component to change but not the URL, in case it falls on the route configured above (404).
Is there any way / built-in to do this with vue / vue-router, or a workaround ?