I\'m new to vuejs and I\'m working on my first project with vue. I\'m just wondering how I will route to my 404.vue component when the requested url is not found.
An
For what I do is I give a class of http-found
to the parent div all my component and I the mounted hook of the App.vue I check using jQuery or Javascript if there is any element with the class of http-found
if not I redirect to my 404 page.
mounted(){
if(!$('.http-found')){
this.$router.push('/404')
}
}