vue3+vite在添加动态路由时,component并没有找到值,代码如下
for (let i =0;i<homeMenuData.menuList.length;i++){
for(let j =0;j<(homeMenuData.menuList[i] as any).childrenList.length;j++){
let list: any = (homeMenuData.menuList[i] as any).childrenList[j]
console.log(list)
console.log(list.component)
router.addRoute({
path:list.path,
name:list.name,
component:() => import(`../../../views/${list.component}`)
})
}
}
运行结果如下
在webstorm中还报错
这个如何解决?