阿臻
阿臻
  • 发布:2020-03-09 19:28
  • 更新:2020-03-10 01:55
  • 阅读:1216

uniapp 使用外部图标比如 iconfont

分类:HBuilderX

说明 错误出现在打包app的情况下,小程序h5没有出现错误

  1. 当我使用

    
    <style lang="scss">@import "/static/css/iconfont.css";</style>  
不起效果,  

2. 下面的就可以,是我引入错了吗,感觉没有错啊  

<style lang="scss">  
    @import "/static/css/reset.css";  

    @font-face {  
        font-family: 'iconfont';  
        /* project id 1680388 */  
        src: url('https://at.alicdn.com/t/font_1680388_xiziamu8lb.eot');  
        src: url('https://at.alicdn.com/t/font_1680388_xiziamu8lb.eot?#iefix') format('embedded-opentype'),  
            url('https://at.alicdn.com/t/font_1680388_xiziamu8lb.woff2') format('woff2'),  
            url('https://at.alicdn.com/t/font_1680388_xiziamu8lb.woff') format('woff'),  
            url('https://at.alicdn.com/t/font_1680388_xiziamu8lb.ttf') format('truetype'),  
            url('https://at.alicdn.com/t/font_1680388_xiziamu8lb.svg#iconfont') format('svg');  
    }  

    .iconfont {  
        font-family: "iconfont" !important;  
        font-size: 16px;  
        font-style: normal;  
        -webkit-font-smoothing: antialiased;  
        -moz-osx-font-smoothing: grayscale;  
    }  

    .icon-yanjing:before {  
        content: "\e62f";  
    }  

    .icon-z-like:before {  
        content: "\e6bf";  
    }  

    /*每个页面公共css */  
    body uni-app uni-page {  
        height: 100%;  
        background-color: #f5f5f5;  
    }  
</style>
2020-03-09 19:28 负责人:无 分享
已邀请:
8***@qq.com

8***@qq.com - 湖北技升

只要ttf,把其他都删了

要回复问题请先登录注册