中等Vue路由
0 1

Vue Router 如何配置404页面?

【概念释义】

通配路由 { path: "*", component: NotFound }routes 最后,捕获未匹配路径。history 模式服务器也要 404 回 index.html 再由前端路由显示 NotFound。

【基础使用】

javascript
const routes = [
  { path: "/", component: Home },
  { path: "/user/:id", component: User },
  { path: "*", name: "NotFound", component: () => import("./404.

登录查看完整 693

回答讨论

暂无讨论,登录后可抢先发言

本题库更多题目(50)