原本我是这样定义图标字体的:(省略woff字体编码)

@font-face {font-family: YDUI-ICONS;
  src: url('../../fonts/iconfont/iconfont.eot?t=1542201734648');
  src: url('../../fonts/iconfont/iconfont.eot?t=1542201734648#iefix') format('embedded-opentype'),
  url('data:application/x-font-woff;charset=utf-8;base64,...) format('woff'),
  url('../../fonts/iconfont/iconfont.ttf?t=1542201734648') format('truetype'),
  url('../../fonts/iconfont/iconfont.svg?t=1542201734648#iconfont') format('svg');
}

然后项目的图标一直是小方框,百思不得其解:

 vue+ydui使用iconfont时图标不显示

然后把woff格式的字体去掉,就可以了:

@font-face {font-family: YDUI-ICONS;
  src: url('../../fonts/iconfont/iconfont.eot?t=1542201734648');
  src: url('../../fonts/iconfont/iconfont.eot?t=1542201734648#iefix') format('embedded-opentype'),
  url('../../fonts/iconfont/iconfont.ttf?t=1542201734648') format('truetype'),
  url('../../fonts/iconfont/iconfont.svg?t=1542201734648#iconfont') format('svg');
}

效果:

vue+ydui使用iconfont时图标不显示

 

相关文章:

  • 2021-12-07
  • 2022-12-23
  • 2021-05-08
  • 2022-12-23
  • 2021-08-09
  • 2021-11-04
  • 2021-12-17
猜你喜欢
  • 2021-11-29
  • 2022-12-23
  • 2021-10-27
  • 2021-08-15
  • 2021-04-30
  • 2021-04-27
  • 2022-12-23
相关资源
相似解决方案