index.js 499B

12345678910111213
  1. import Vue from 'vue'
  2. import SvgIcon from '@/components/SvgIcon'// svg组件
  3. import generateIconsView from '@/views/svg-icons/generateIconsView.js'// just for @/views/icons , you can delete it
  4. // register globally
  5. Vue.component('svg-icon', SvgIcon)
  6. const requireAll = requireContext => requireContext.keys().map(requireContext)
  7. const req = require.context('./svg', false, /\.svg$/)
  8. const iconMap = requireAll(req)
  9. generateIconsView.generate(iconMap) // just for @/views/icons , you can delete it