5
I’m working on a page 404, work well, 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 too, but I just want the view/component to change, and the URL to remain.
I find it very annoying to be redirected to http://example.com/404, if I’m wrong about something I have to type the whole url or go through the browser Autofill, I don’t like it anyway.
I was wondering if there’s any method/logic for you to have something like https://www.facebook.com/sdfsd/sfsdf/asfasfsafastgtgregre.
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?