Vue2:注册子路由
const routes = [ { path: '/a', name: 'a', component: () => import("../views/a/index.vue"), redirect: "/a/a1", //用输入的是/a路由 帮他重定向到 /a/a1 children: [{ path: "a1", name: "a1", component: () => import("../views/a/views/a1/index.vue") }, { path: "/*", component: () => import("../views/a/views/a1/index.vue") } ] }, { path: '/*', component: () => import("../views/err/index.vue"), } ]