在const声明路由规则时名字必须为routes
const routes = [
{
path: "/",
component: () => import("../components/a.vue"),
},
{
path: "/b",
component: () => import("../components/b.vue"),
},
{
path: "/c",
component: () => import("../components/c.vue"),
},
{
path: "*",
redirect: "/",
},
];