Răsfoiți Sursa

修复生产环境菜单资源加载异常问题

cfort 1 an în urmă
părinte
comite
b1d13cb23d
1 a modificat fișierele cu 2 adăugiri și 17 ștergeri
  1. 2 17
      src/utils/util.import.production.js

+ 2 - 17
src/utils/util.import.production.js

@@ -9,22 +9,7 @@
 // module.exports = file => () => import('@/views' + file)
 
 module.exports = (file, params = {}) => {
-    // 如果路径包含 `?`,提取参数
+    // 兼容菜单URL传参
     const [path, query] = file.split('?')
-    const component = import('@/views' + file)
-
-    // 如果有参数,附加到组件
-    if (query || Object.keys(params).length) {
-        const queryParams = new URLSearchParams(query || '')
-        const allParams = { ...Object.fromEntries(queryParams), ...params }
-
-        // 方法仅初始化调用,返回 props 无用,菜单URL参数通过 defaultUrl 获取
-        // return {
-        //     ...component,
-        //     props: allParams
-        // }
-        return component
-    }
-
-    return component
+    return () => import('@/views' + path)
 }