解决element-ui图标乱码

创建css-unicode-loader.js文件

const UNICODE_MATCH_REG = /[^\x00-\xff]/g;
const CONTENT_MATCH_REG = /(?

配置vue.config.js,引用css-unicode-loader.js文件

configureWebpack: config => {
    config.module.rules.filter(rule => {
      return rule.test.toString().indexOf("scss") !== -1;
    })
      .forEach(item => {
        item.oneOf.forEach(oneOfRule => {
          oneOfRule.use.splice(oneOfRule.use.indexOf(require.resolve('sass-loader')), 0,
            { loader: require.resolve('./css-unicode-loader') })
        })
      })
  }

你可能感兴趣的:(解决element-ui图标乱码)