美文网首页
iconfont的使用(下载使用)

iconfont的使用(下载使用)

作者: Echo_前端 | 来源:发表于2018-08-09 13:29 被阅读0次

1、下载文件

在src下新建iconfont文件夹

2、在生命周期中引入项目

    beforeCreate () {

      var domModule = weex.requireModule('dom');

      // 目前支持ttf、woff文件,不支持svg、eot类型,moreItem at http://www.iconfont.cn/

      domModule.addRule('fontFace', {

        'fontFamily': 'iconfont2',

        'src': 'url(\'bmlocal://iconfont/iconfont.ttf\')'

      });

      domModule.addRule('fontFace', {

        'fontFamily': 'iconfont3',

        'src': 'url(\'bmlocal://iconfont/iconfont.woff\')'

      })

    },

3、使用

这里用的是iconfont的第一种方法

4、加样式

fontfamily

相关文章

网友评论

      本文标题:iconfont的使用(下载使用)

      本文链接:https://www.haomeiwen.com/subject/nrwqbftx.html