解决办法是,将父级的name去掉。(大多数情况下是按name来跳转的,不过这样一改,调到父级就得用路径跳转了);
下面上一下路由的配置:
{
path: "/index",
component: () =>
import("./pages/index.vue"),
children:[
{
path:"/",
name:"com1",
component: () =>
import("./components/com1.vue"),
}
]
}
注意。父级路由没有name哦