错误信息如下:
解决方法
进入router中的index.js
component: () => import('@/views/login/login'),
改为
component: (resolve) => require(["@/views/login/login"], resolve),
如果是动态路由则
export const loadView = (view) => { // 路由懒加载
return () => import(`@/views/${view}`)
}
改为
export const loadView = (view) => { // 路由懒加载
return (resolve) => require([`@/views/${view}`], resolve)
}
就OK了。