解决办法 1. srore/modules/permission.js export const loadView = (view) => { if (process.env.NODE_ENV === "development") { return (resolve) => require([`@/views/${view}`], resolve); } else { // return () => import(`@/views/${view}`); return (resolve) => require([`@/views/${view}`], resolve); } }; 2. router/index (修改动态路由的导入方式) export const dynamicRoutes = [ { path: "/system/user-auth", component: Layout, hidden: true, permissions: ["system:user:edit"], children: [ { path: "role/:userId(\\d+)", // component: () => import("@/views/system/user/authRole"), component: (resolve) => require(["@/views/system/user/authRole"], resolve), name: "AuthRole", meta: { title: "分配角色", activeMenu: "/system/user" }, }, ], }, ]