在进行如下路由跳转时
const edit = (index: number) => {
let row: any = categoryData.value[index];
router.push({ name: “commodityedit”, query: { id: row.id, name: row.name } });
};
遇到问题如下
TypeError: Failed to fetch dynamically imported module: http://localhost:4000/src/views/product/commodityedit.vue
triggerError @ vue-router.esm-bundler.js:3325
(匿名) @ vue-router.esm-bundler.js:3057
Promise.catch(异步)
pushWithRedirect @ vue-router.esm-bundler.js:3051
push @ vue-router.esm-bundler.js:2986
install @ vue-router.esm-bundler.js:3403
use @ runtime-core.esm-bundler.js:4327
(匿名) @ main.ts:19
vue-router.esm-bundler.js:72 [Vue Router warn]: Unexpected error when starting the router: TypeError: Failed to fetch dynamically imported module: http://localhost:4000/src/views/product/commodityedit.vue
warn @ vue-router.esm-bundler.js:72
(匿名) @ vue-router.esm-bundler.js:3405<

在尝试使用 Vue 路由进行动态模块导入时遇到问题,错误提示为 `TypeError: Failed to fetch dynamically imported module...`。该问题可能由于路由文件名错误或文件位置不正确导致。解决方案包括检查路由文件名拼写和路径配置的准确性。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



