vue cli3 的子路由 无非就是在父级路由下创建一个子级路由children来包括起来
const routes = [
{path:"/", component:ResourceHome},
{path:"/new", component:ResourceNew,
children:[
{path:"",component:ResourceName},
{path:"other"component:RespourceOther}
]
},
]
//创建路由
const router = createRouter({
history:createWebHistory(),
//第一个router是参数,第二个routes是配置路由中的routes,可以只写一个routes
routes
});
其他的方式引入是不变的,该引入的还是需要进行一次引入