|
@@ -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)) {
|