配置子路由
import { createRouter, createWebHistory } from "vue-router";
import About from "../views/About.vue";
const routes = [
{
path: "/",
name: "index",
component: () => import("../views/index.vue"),
children: [
{
path: "/fabu",
name: "fabu",
component: () => import("../views/fabu.vue"),
},
{
path:"/biaoqian",
name:"biaoqian",
component: () => import("../views/biaoqian.vue"),
},
{
path:"/fenlei",
name:"fenlei",
component: () => import("../views/fenlei.vue"),
},
{
path:"/shouye",
name:"shouye",
component: () => import("../views/shouye.vue"),
},
{
path:"lixiang",
name:'lixiang',
component: () => import("../views/lixiang.vue"),
}
],
},
{
path: "/about",
name: "About",
component: About,
},
];
const router = createRouter({
history: createWebHistory(),
routes,
});
export default router;