原来的iconfont.css:

@font-face {
  font-family: "iconfont"; /* Project id 2762712 */
  src: url('iconfont.woff2?t=1631523743638') format('woff2'),
       url('iconfont.woff?t=1631523743638') format('woff'),
       url('iconfont.ttf?t=1631523743638') format('truetype');
}

.iconfont {
  font-family: "iconfont" !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

......

url改用绝对路径,App端就可以正常显示iconfont图标了。修复后的iconfont.css:

@font-face {
  font-family: "iconfont"; /* Project id 2762712 */
  src: url('~@/static/iconfont/iconfont.woff2?t=1631523743638') format('woff2'),
       url('~@/static/iconfont/iconfont.woff?t=1631523743638') format('woff'),
       url('~@/static/iconfont/iconfont.ttf?t=1631523743638') format('truetype');
}

.iconfont {
  font-family: "iconfont" !important;
  font-size: 16px;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

......
 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐