12345678910111213141516171819202122232425 |
- 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
|