解決辦法是,將父級的name去掉。(大多數情況下是按name來跳轉的,不過這樣一改,調到父級就得用路徑跳轉了);
下面上一下路由的配置:
{
path: "/index",
component: () =>
import("./pages/index.vue"),
children:[
{
path:"/",
name:"com1",
component: () =>
import("./components/com1.vue"),
}
]
}
注意。父級路由沒有name哦
