You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
641 B
JavaScript
26 lines
641 B
JavaScript
/*
|
|
* @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
|