路由别名配置 - alias
- 配置路由重定向,当用户访问/a的时候,URL会被替换/b之后匹配实际路由/b
- 配置路由别名,/a的别名是/b,当用户访问/b的时候,URL会保持为/b,但路由匹配为/a,和用户访问/a一样
const routes: Array<RouteRecordRaw> = [
{
path: "/home",
alias: "home",
component: () => import("@views/home.vue"),
},
]
404路由页面配置
配置一个404路由代替站内的404页面
配置方法
const routes: Array<RouteRecordRaw> = [
{
path: "/:pathMatch(.*)*",
name: "404",
component: () => import("@views/404.vue"),
}
]
标签:配置,别名,404,home,路由,页面
From: https://www.cnblogs.com/openmind-ink/p/17027283.html