uniapp引入iconfont

@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;
}

你可能感兴趣的:(uniapp引入iconfont)