bordersList.js 433 B

12345678910111213141516
  1. // 得到边框组件的远程列表
  2. // import _ from 'lodash'
  3. const files = require.context('../BorderComponents/', true, /index.vue$/)
  4. const borderComponents = []
  5. files.keys().forEach(key => {
  6. const title = key.split('/')[1].replace('.vue', '')
  7. const img = require(`../BorderComponents/${title}/component.png`)
  8. borderComponents.push({
  9. title:title,
  10. img,
  11. })
  12. })
  13. // 抛出边框组件
  14. export default borderComponents