最简单的配置路由的方法是什么,以便在访问不存在的路由时将其重定向到找不到的页面404?
Vue-Router
path:*: redirect:/404
这会将vue-router中丢失的路由重定向到/ 404
如果您在末尾添加一条路线以捕获所有路线:
{ path: "*", component: NotFoundPage }
应该这样做,但要确保它是最后一条路线
关键字导航卫士:https://forum.vuejs.org/t/best-practice-to-redirect-to-404-a-dynamic-route/35445/2
关键字vue路由器自定义404(教程):https://reactgo.com/vue-router-404-page/