引入阿里巴巴图标库
2021-03-21 本文已影响0人
偶头像超凶
uniapp的vue文件引入阿里巴巴图标库
1、首先将iconfont.css文件进行处理,将红色框选部分删除,第一张图留一个 src
,第二张图留一个;


2、使用(都会吧,不说了),如图(用Font class)
<text class="iconfont icon" style="font-size: 30rpx;"></text>
uniapp的nvue文件引入阿里巴巴图标库
1、在app.vue文件中引入,src中引入的iconfont.ttf文件就是下载文档中的iconfont.ttf
export default {
onLaunch: function() {
const domModule = weex.requireModule('dom')
domModule.addRule('fontFace', {
'fontFamily': 'iconfont',
'src': "url('./common/css/iconfont.ttf')"
})
}
}
2、使用,如图(用Unicode)
<text class="iconfont" style="font-size: 30rpx;"></text>