Answer the question
In order to leave comments, you need to log in
How to properly render 404 pages with Vue Router?
Now in the route at the very end there is a construction for 403, 404 errors:
....
{
path: '/error/403',
name: 'error_403',
component: E403
}, {
path: '/error/404',
name: 'error_404',
component: E404
}, {
path: '*',
redirect: {name: 'error_404'}
}
if(response.status == 403) {
this.$router.push({name: 'error_403'});
} else if(response.status == 403) {
this.$router.push({name: 'error_404'});
}
Answer the question
In order to leave comments, you need to log in
wrote an article on the topic of 404 in vue
, I do not pretend to be true, but it works fine
https://habr.com/en/post/523078/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question