uniapp引入iconfont
2020-06-18 本文已影响0人
北悸安凉_b2de
@font-face {
font-family: 'iconfont'; /* project id 1891251 */
src: url('https://at.alicdn.com/t/font_1891251_qp6xit97d88.eot');
src: url('https://at.alicdn.com/t/font_1891251_qp6xit97d88.eot?#iefix') format('embedded-opentype'),
url('https://at.alicdn.com/t/font_1891251_qp6xit97d88.woff2') format('woff2'),
url('https://at.alicdn.com/t/font_1891251_qp6xit97d88.woff') format('woff'),
url('https://at.alicdn.com/t/font_1891251_qp6xit97d88.ttf') format('truetype'),
url('https://at.alicdn.com/t/font_1891251_qp6xit97d88.svg#iconfont') format('svg');
}
onLaunch: function() {
console.log('App Launch');
let domModule = weex.requireModule('dom');
domModule.addRule('fontFace', {
fontFamily: 'iconfont',
src: "url('https://at.alicdn.com/t/font_1891251_qp6xit97d88.ttf')"
});
},
.iconfont {
font-family: iconfont;
}
<text class="iconfont"></text>