3328350766
6 天以前 761eb03d6b3bebd0b197179564c84d89d3d12a0d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * @description: 处理自定义远程的组件
 * @Date: 2023-06-02 10:18:46
 * @Author: xing.heng
 * @LastEditors: xing.heng
 * @LastEditTime: 2023-06-05 18:39:21
 */
 
const files = require.context('./', true, /index.vue$/)
const remoteComponents = []
 
files.keys().forEach(key => {
  const title = key.split('/')[1].replace('.vue', '')
  const img = require(`./${title}/component.png`)
  const config = require(`./${title}/config.js`).default
  remoteComponents.push({
    title: config.title || title,
    vueSysComponentDirName: title,
    vueFile: files(key).default,
    ...config,
    img
  })
})
 
export default remoteComponents