This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
import Vue from 'vue'
import SvgIcon from '@/components/SvgIcon'// svg组件
// 全局注册
Vue.component('svg-icon', SvgIcon)
// 要引入svg下面所有的svg文件: 在该文件(icons)目录下新建一个js文件index.js 写如下代码:
const req = require.context('./svg', false, /\.svg$/) // require.context函数遍历svg文件夹的所有文件一次性导入到index.js中
const requireAll = requireContext => requireContext.keys().map(requireContext)
requireAll(req)