【uniapp-推荐阿里巴巴矢量图www.iconfont.cn】基于阿里巴巴矢量图标如何导入uniapp总结
作者:互联网
/*
1、由于当前项目为uniapp项目,绝对路径必须加@
2、如果绝对路径不加【~@】则会报错【Failed to decode downloaded font: http://localhost:8080/xxx/iconfont/iconfont.ttf】
3、参考uniapp框架关于icon使用的官方文档:https://uniapp.dcloud.io/frame?id=%e5%ad%97%e4%bd%93%e5%9b%be%e6%a0%87
*/
@font-face {
font-family: "iconfont"; /* Project id 2898895 */
src: url('~@/common/style/css/iconfont/iconfont.woff2') format('woff2'),
url('~@/common/style/css/iconfont/iconfont.woff') format('woff'),
url('~@/common/style/css/iconfont/iconfont.ttf') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-ETH:before {
content: "\e60c";
}
标签:uniapp,style,阿里巴巴,矢量图,e5%,iconfont,common,font 来源: https://blog.csdn.net/weixin_43343144/article/details/121114350