兼容多个svg
jianxiaofei opened this issue · comments
使用 vue cli 3,可以通过配置 vue-svg-loader 来将 svg 图标作为 Vue 组件导入
// vue.config.js
module.exports = {
chainWebpack: config => {
const svgRule = config.module.rule('svg');
svgRule.uses.clear();
svgRule.use('vue-svg-loader').loader('vue-svg-loader');
},
};
这样配置后其他的svg 链接引入,如echarts 的图标引入,require()图标引入 都不起作用了,也不会打包svg了?