运行代码出错,无法运行,错误在于插件vite:import-analysis
来源:1-1 课前须知,这里有你需要了解得一切

慕设计9348276
2021-05-27
let routes = utils.generateRoute(menuList)
routes.map(route => {
let url = ./../views/${route.component}.vue
route.component = () => import(url);
router.addRoute(“home”, route);
})
提示这段动态引入不能给vite解析,请问老师应该如何解决? 谢谢。
错误信息如下:
9:38:59 ├F10: AM┤ [vite] warning:
D:/daniel/manager-fe/src/router/index.js
55 | routes.map(route => {
56 | let url = ./../views/${route.component}.vue
57 | route.component = () => import(url);
| ^
58 | router.addRoute(“home”, route);
59 | })
The above dynamic import cannot be analyzed by vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#l
imitations for supported dynamic import formats. If this is intended to be left
as-is, you can use the / @vite-ignore / comment inside the import() call to su
ppress this warning.
Plugin: vite:import-analysis
File: D:/daniel/manager-fe/src/router/index.js
1回答
-
河畔一角
2021-05-31
你的let url为什么没有引号?
022021-06-04
相似问题