美文网首页
Ant Design使用离线Icon

Ant Design使用离线Icon

作者: _请输入昵称 | 来源:发表于2019-01-30 14:05 被阅读0次

    项目antd版本号:"antd": "3.7.3",
    antDesignPro版本:"name": "ant-design-pro", "version": "1.3.0",

    解决办法
    安装antd-iconfont

    npm i antd-iconfont
    npm run build
    

    1.将node-modules里面的antd-iconfont放到static目录下,文件夹命名iconfont,如下图所示


    image.png

    2.在dist下css文件中搜索https://at.alicdn.com,替换成iconfont里面的相对路径,我这里有四处,.eot .woff等

    url("./static/iconfont/iconfont.eot");
    url("./static/iconfont/iconfont.woff") format("woff"),
    url("./static/iconfont/iconfont.ttf") format("truetype"),
    url("./static/iconfont/iconfont.svg")
    

    就酱,缺点是每次build都要修改dist文件

    目前更简便更合适的方法还没找到。。。

    相关文章

      网友评论

          本文标题:Ant Design使用离线Icon

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