vuejs / vue-router

🚦 The official router for Vue 2
http://v3.router.vuejs.org/
MIT License
18.99k stars 5.06k forks source link

check path 404 #3874

Closed zhuchaoling closed 10 months ago

zhuchaoling commented 10 months ago

Is there a feature to detect a 404 error in an API? For example, if the path is 404, return true and redirect to the homepage.

const isNotFoundPath = router.checkNotFound('/test/404') // true

posva commented 10 months ago

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.