Explorar el Código

Merge branch 'master' of http://121.40.253.172:3000/pengyue/jsh_erp into master_huangjunjie

huang hace 1 semana
padre
commit
e05a1f44df
Se han modificado 1 ficheros con 7 adiciones y 2 borrados
  1. 7 2
      jshERP-web/src/utils/util.js

+ 7 - 2
jshERP-web/src/utils/util.js

@@ -104,10 +104,15 @@ function generateChildRouters(data) {
     let componentPath = ''
     item.route = '1'
     if (item.component.indexOf('layouts') >= 0) {
-      componentPath = () => import('@/components' + item.component)
+      componentPath = (resolve) => require([`@/components${item.component}`], resolve)
     } else {
-      componentPath = () => import('@/views' + item.component)
+      componentPath = (resolve) => require([`@/views${item.component}`], resolve)
     }
+    // if (item.component.indexOf('layouts') >= 0) {
+    //   componentPath = () => import('@/components' + item.component)
+    // } else {
+    //   componentPath = () => import('@/views' + item.component)
+    // }
     // eslint-disable-next-line
     let URL = (item.url || '').replace(/{{([^}}]+)?}}/g, (s1, s2) => eval(s2)) // URL支持{{ window.xxx }}占位符变量
     if (isURL(URL)) {