微信小程序引入外部icon最详细介绍
1.获取图标
阿里矢量库:iconfont-阿里巴巴矢量图标库
选中相应的图标
- 添加图标到购物车(多个图标)
- 添加项目
- 下载本地
- 解压转换—-》 转化网站:Online @font-face generator — Transfonter
2.小程序引用
- 文件复制指引
- 矢量库文件中的内容被转换的文件内容替换,之后总文件在到wcssapp.wcss文件内容如下:
@font-face { font-family: 'iconfont'; src: url('data:font/woff2;charset=utf-8;base64,d09GMgABAAAAAAtwAA0AAAAAFUgAAAsZAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP0ZGVE0cGh4GYACCWhEICpwglVALIgABNgIkAy4EIAWFAgeBdRvqEDOjtnKQ0pH9FwlxwPWwJ/SMuZtOR+NE1dLFwN6t05FSOmMRv4VNyoqunv/pNT7lo1n9fuz2iX5DxEMhFLdqEon+huSWKiWKR0pl/v9Pva9+DlUymQsgqcC0U5duTkqsmoWvnR2uDZeqWTRSSWnze9v8pSdagIf4k737dxvwhmnm3+KEv4YeYDyKkwRucK5M7l3yMvBArEANobB7NwI3+WxTC7RxyyOAXs+5n1zLbLYIrnWYomzH18o0W0gOs2VOcXOqgCmQRBSmtg4xfSQJKOtevnxt/7LNIhOW4JrFqvak7Z2HExFOp5dx8xEgot9X/EEHozRiWiFltaRcCgQhLhTHmc0oeo2PtJ0yAX/vMEC2J5M8leGnTyb4vRG/xXK3F/wrXkBArdU1Ow/t5TgdZ1ZAqI52Vcdg2O/25vqb12+xbv7Eb65aQN/1fMWdxzXhjh7oGdhlJreOg5Dw/x4gZeg+aPdMqwb9PuIdKFdqUcTwkBuawpodSZTPER1cFl9iRaPrwCUwFieteLgDhEXVJCoiolwTjs4Av7CITaU+TTSjHfY4olyYFivW43hGJXSVU36wbqF+8Ci9dJmrn2/Tu+azcl0wxRQL8qn89t9KdZCtMNYIN4mBE6+Ku5RVVOel0wLi4f5vc3L3z+2ckjK3mEKzHVy1PMY6BZGUiOs2pRrF55U1hyeSOvtGF7LVXCBE/YgptXL1g/QSH0U23m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zImVyuJkiAE5aIAW73/b9khi3/Eza97ojFG5NO8+TqXr3VPyotLvp7W97ReHHT/zFzBWejZsqMcLYj9Gq+14r9clc1+vPbWSWkP9GV7ewDgSV3gNvRZbcIRu2khRSDTp0vYkzvJwsA3GKKhghId824aImGC+0X8jc57Ta2gpGMbbwpcQO/gy/TJsh1z6Cj+qeDz+HR/+PLaHnhre7pxgyg1M2z257TbWndRkxY1axJxYE9y8soi9TjeFERtz15dVTTMO4tyLjWVuYK9cfOaMSammdfnUgVUuvEUfRvac/TjOS146tKf7DvBsEP/jDyX/rqeQRTv/HnlB85mT7z2bV07QIoMtoM9BIh5lBYDBL5B4eboyH0wgaEdI10bSmZTvm85sPNfwotGZa2DGGSJHIdE/FbmebKAsj0UJwRiEjLYEOSNowvMJSt4zVIwv6LSFs9nLi7USfMuWNQIUQsYZMokpyGVKNOGpglKhCahkzkNn0v88rzFywZfFID5OSJ2kq5PnIZQCX+C1vnaB5794fj4FGDFAfd0oRggyiNX6dd3hDh8+TT6JsRzofeLIjgPwXH7ljnYOU7UuazFdeohihUh4I6EeL8pmOc1zu+8yipjMp6plLcVpQinBFt2Br3S4VsQcp0qf/SQff38Jv07L/KeHEgCWV8+1D3t/suwVl9xlbNLees1qz56Mn1QMmPF6Oqnnk3lfwIKBQ0BCQcPAwsEjQozEzNjmsoEmqPcuqxKqEGASARUZqGoD1FCy97hD/w0LVxVe2xLB6yKBFSKBZjCqFBZzK2g9KH2gfcaMCgKynpT7fi7Hx0B8itRUI0AG/r8uxEgOQO7lod9IwGreBCQsgJOES2NRDUelAXmC3FAYmmKKFAAA') format('woff2'), url('data:font/woff;charset=utf-8;base64,d09GRgABAAAAAA6kAA0AAAAAFUgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAAOiAAAABoAAAAck2xeRUdERUYAAA5oAAAAHgAAAB4AKQAWT1MvMgAAAaAAAABGAAAAYDxUSd5jbWFwAAACDAAAAFcAAAFaztPQJGdhc3AAAA5gAAAACAAA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qb/WPeNibJAw2nFp4k0yc0ctR1pTpjkUHNm3NPoI0KNsXLGyme4HvaP2W9qzMuLwngW2POaAqqdR83O0p6SJxBheISFr5GVvTSWkHjDWZMb9/pViGw+8j3TkbKon3NYkidW5s2sTeg4vyz1yDNHlGx2kB+XhU455nw+73UgCgtCm+AYPanCHAAB42m1M7Q6CQAxjKPJNNP71FS5R3miEg5uBnYIX4Z7eJfDTZk27pG0QBhuy4D/OQghCCOEAR4jgBDEkkEIGORRQQpWgMto7W99Q9ZZ7sb1DHkgZRyttvk5RzQYH6x7XL9KA1Grun+SlMCCXk+ZVglu42L+F5C6o6vs29SbkFm3+QjKSbYTZpEfNxuGHIm+osaV3skKz0dxprhapzIZGkU5TvC/8APuARDcAAAAB//8AAgABAAAADAAAABYAAAACAAEAAwAPAAEABAAAAAIAAAAAeNpjYGBgZACCq0vUOUD0vSfS82A0AEITBqAAAA==') format('woff'), url('iconfont.ttf') format('truetype'); font-weight: normal; font-style: normal; font-display: swap; } .iconfont { font-family: "iconfont" !important; font-size: 16px; font-style: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .icon-a-hezuo2:before { content: "\e61f"; } .icon-a-gongzuoguanli-huiyiguanli2:before { content: "\e620"; } .icon-a-shalou1:before { content: "\e621"; } .icon-wailaidengjizonglan:before { content: "\e6cf"; } .icon-renyuanguanli:before { content: "\e6d0"; } .icon-renyuanxinxi:before { content: "\e6d1"; } .icon-a-20-huiyiqiandao:before { content: "\e6e5"; } .icon-paihangbang:before { content: "\e707"; } .icon-remenhuati:before { content: "\e708"; } .icon-zhibo:before { content: "\e709"; } .icon-zunguishenfen:before { content: "\e70a"; } .icon-xianshimianfei:before { content: "\e70b"; } .icon-qiandao:before { content: "\e70c"; }
- 使用
<icon class="iconfont icon-renyuanguanli">DSAF</icon> <icon class="iconfont icon-a-hezuo2">DSAF</icon>
注意,有色图标用不了,效果如第一个图所示
如果你觉得有用,请给个赞吧👍!!
如果你觉得有用,请给个赞吧👍!!
如果你觉得有用,请给个赞吧👍!!
文章来源地址https://www.toymoban.com/news/detail-492923.html
文章来源:https://www.toymoban.com/news/detail-492923.html
到了这里,关于微信小程序引入外部icon的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!