font-class引用
font-class是unicode使用方式的一种变种,主要是解决unicode书写不直观,语意不明确的问题。与unicode使用方式相比,具有如下特点:
- 兼容性良好,支持ie8+,及所有现代浏览器。
- 相比于unicode语意明确,书写更直观。可以很容易分辨这个icon是什么。
- 因为使用class来定义图标,所以当要替换图标时,只需要修改class里面的unicode引用。
- 不过因为本质上还是使用的字体,所以多色图标还是不支持的。
第一种方式:.css文件放在项目中,通过import引入到App.vue文件的style标签内
使用步骤如下:
以iconFont字体为例
1、在阿里巴巴矢量图标库中选择合适的图标,加入购物车
2、点击购物车,点击“下载代码”
3、先将字体图标拷贝到static的fonts目录下
4、如果希望字体图标在整个APP中都起作用,我们可以在app.vue的style中将字体图标引入。
@import url("./static/fonts/iconfont.css");
注意:要修改iconfont.css文件中引入其他文件时的路径,将src: url('iconfont.eot?t=1576844226174');修改为src: url('~@/static/fonts/iconfont.eot?t=1576844226174');
iconfont.css内容如下:里面包含font-face,iconfont样式和具体图标的样式
@font-face {font-family: "iconfont"; src: url('~@/static/font/iconfont.eot?t=1576844226174'); /* IE9 */ src: url('~@/static/font/iconfont.eot?t=1576844226174#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAVMAAsAAAAAChwAAAT9AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDKAqHQIYhATYCJAMUCwwABCAFhG0HUBurCFGUTk6f7Edh3LaEI5xY7HYeoWNK7zwLfd/7ZDz8/37f9rny/h3XpE711SdNQq1REh4bhEQoLLJn8v/facvNLUze6duSsZbv+GnTlb7095Zi+lMOtlEU4UA4hIXh39Neujkz1HYC0ju3M1Ac9Uf+ce/0z/PA5qOyXP5orGFznpcFmGBAY2xsawEOyhL0FvEsLiQTuJ7AoFUtsVtbBxckq4BugXjNDYVkbRYlhBOavvMZW7ZjpmrpbfpEfFY/H/8MIktSM+h78XRTJys/2///CaSPuC0jpPm5cJtExh6iEM99PQ8l9NiehMFPZtIVRMN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9ecgUKSHKAHY8EAjjHiEZ9RWycRFayG+oZv1CZzwSMOgyGnMO2QieX5egIOhUnVCuCY8JdsxrxWdghI4irXKVewUy4EHa7/ScyW3wQOYxIBgaA0RGmRQu3SKbgeMI6kthgYYdE9Gf63aZ35k6mnBJ3k0SUCCgo1QTFKcRPEyujvKu958BhpBDIUNKfiSvACnAa6f6Onox0G2NF6tkXRoHhgwDCDHeiZEEF7VFXcDBmED5/q0sQIM6zBQR35wuq8Tiajrl69xpLD0VysKcNVLkKFGj070xuc+9NIZyWPEKRig1moQj4YKXnvKJzUwIAAAA') format('woff2'), url('~@/static/font/iconfont.woff?t=1576844226174') format('woff'), url('~@/static/font/iconfont.ttf?t=1576844226174') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ url('~@/static/font/iconfont.svg?t=1576844226174#iconfont') format('svg'); /* iOS 4.1- */ } .iconfont { font-family: "iconfont" !important; font-size: 16px; font-style: normal; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .icon-shipin:before { content: "\f0024"; } .icon-tupian:before { content: "\e650"; } .icon-guanyuwomen:before { content: "\e608"; } .icon-ziyuan:before { content: "\e60d"; }
5、在页面中通过class的形式使用字体图标,其中iconfont类名是必须要有的。
<view class="iconfont icon-tupian"></view>
-
字体文件小于 40kb,
uni-app
会自动将其转化为 base64 格式; -
字体文件大于等于 40kb, 需开发者自己转换,否则使用将不生效;
-
字体文件的引用路径推荐使用以 ~@ 开头的绝对路径
@font-face { font-family: test1-icon; src: url('~@/static/iconfont.ttf'); }
第二种方式:使用字体图标的方式:即直接将.css文件拷贝到App.vue文件的样式中,再使用
以yticon字体图标为例,使用步骤如下:
第一步:拷贝项目下面生成的fontclass代码:
在浏览器地址栏输入地址:
https://at.alicdn.com/t/font_1078604_w4kpxh0rafi.css
将代码拷贝到项目的App.vue的样式中
@font-face {font-family: "yticon";
src: url('//at.alicdn.com/t/font_1078604_w4kpxh0rafi.eot?t=1556458543664'); /* IE9 */
src: url('//at.alicdn.com/t/font_1078604_w4kpxh0rafi.eot?t=1556458543664#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAACkIAAsAAAAASWwAACi2AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCMFArzeNtYATYCJAOCIAuBEgAEIAWEVQeGfxvxO2WGmMcBUFN3RUS1qImiTipKUvb/XxPkGDGYepPntSpIThtX8KRd2ckdhNM2yUHFS5wre+SJI814aaZX+ggECd2MOV3SmVMS5GZaI78YAYLgupRjWzhQsMwvbXUt/7pXatmrDqVMCHC/323viygmHskNQkk3+IGf2/+5sWBRjMFGLRCG0mNEjjEGgsCoITVGDgEFrGE8mA1YKAYzUfyCE79gFAb284GKlaC+50sUKyEgTv1MDnE42FqxOKdAz6fQGkpbIAFgNTVnXwfS4cUCWZ9CqO22dZufD/zfVNOuZvc1TcPCb5fJW1qZ6urDSyAJFUIhAfulg7kFdauYS8JPMG/w6nXr/aGY2373dfSVNlgQDJaVUAXFkKyCCo457zutrMKBlLQLltw0u5ykdAidOcSZNRQOWl7k/Ni/8q9kStoOmDP0dgsDhUUYMPwf+v2v7QfxaplIyCZZnxxC0ZKWulsDh9Bs5g74/x4DM+dgoenNJQJ4eLvxASb+jM8ku/0lLYijVhrlMba2DiMJOGPs/1TVFVQzvaU2xI9pdVhaXZYs2/1T4/FICUfK5Ug1UHo2Ifg5ONIFcKl9y1Tq2/MeTiUm6AZKKSTTqJTat0zJmGHLNGbdPAf+ncjKSx2igvSnSW2Hk+MGufS/iWq3m5dmYSgRmSPiKBFK6r1/PiMAKpx4QCqfa3VkOOcsAMKCxl3kSA9nNAG5I1KqMSA7CXLYGA4Afsj34Q95kAFEhAicy+9RdUDxgu/Gmcplowb78kbgVAMywB4gB+KTOoWzyF/2YChv74mDuiPgihDO7uXikZRR1hEvWTqtcnPM02C51fY4HryJUeNkqNW1c3ztl0KuFM5Y0j7emYMgJjet8mx2v8RDCZ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tEr5Qs5Knk4nc/E2ZVv2a2J3WWBCOX9XOVM4cjF+5l8gGEj+CAAAAA==') format('woff2'),
url('//at.alicdn.com/t/font_1078604_w4kpxh0rafi.woff?t=1556458543664') format('woff'),
url('//at.alicdn.com/t/font_1078604_w4kpxh0rafi.ttf?t=1556458543664') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('//at.alicdn.com/t/font_1078604_w4kpxh0rafi.svg?t=1556458543664#yticon') format('svg'); /* iOS 4.1- */
}
.yticon {
font-family: "yticon" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-iconfontshanchu1:before {
content: "\e619";
}
.icon-iconfontweixin:before {
content: "\e611";
}
.icon-alipay:before {
content: "\e636";
}
.icon-shang:before {
content: "\e624";
}
.icon-shouye:before {
content: "\e626";
}
.icon-shanchu4:before {
content: "\e622";
}
.icon-xiaoxi:before {
content: "\e618";
}
.icon-jiantour-copy:before {
content: "\e600";
}
.icon-fenxiang2:before {
content: "\e61e";
}
.icon-pingjia:before {
content: "\e67b";
}
.icon-daifukuan:before {
content: "\e68f";
}
.icon-pinglun-copy:before {
content: "\e612";
}
.icon-dianhua-copy:before {
content: "\e621";
}
.icon-shoucang:before {
content: "\e645";
}
.icon-xuanzhong2:before {
content: "\e62f";
}
.icon-gouwuche_:before {
content: "\e630";
}
.icon-icon-test:before {
content: "\e60c";
}
.icon-icon-test1:before {
content: "\e632";
}
.icon-bianji:before {
content: "\e646";
}
.icon-jiazailoading-A:before {
content: "\e8fc";
}
.icon-zuoshang:before {
content: "\e613";
}
.icon-jia2:before {
content: "\e60a";
}
.icon-huifu:before {
content: "\e68b";
}
.icon-sousuo:before {
content: "\e7ce";
}
.icon-arrow-fine-up:before {
content: "\e601";
}
.icon-hot:before {
content: "\e60e";
}
.icon-lishijilu:before {
content: "\e6b9";
}
.icon-zhengxinchaxun-zhifubaoceping-:before {
content: "\e616";
}
.icon-naozhong:before {
content: "\e64a";
}
.icon-xiatubiao--copy:before {
content: "\e608";
}
.icon-shoucang_xuanzhongzhuangtai:before {
content: "\e6a9";
}
.icon-jia1:before {
content: "\e61c";
}
.icon-bangzhu1:before {
content: "\e63d";
}
.icon-arrow-left-bottom:before {
content: "\e602";
}
.icon-arrow-right-bottom:before {
content: "\e603";
}
.icon-arrow-left-top:before {
content: "\e604";
}
.icon-icon--:before {
content: "\e744";
}
.icon-zuojiantou-up:before {
content: "\e605";
}
.icon-xia:before {
content: "\e62d";
}
.icon--jianhao:before {
content: "\e60b";
}
.icon-weixinzhifu:before {
content: "\e61a";
}
.icon-comment:before {
content: "\e64f";
}
.icon-weixin:before {
content: "\e61f";
}
.icon-fenlei1:before {
content: "\e620";
}
.icon-erjiye-yucunkuan:before {
content: "\e623";
}
.icon-Group-:before {
content: "\e688";
}
.icon-you:before {
content: "\e606";
}
.icon-forward:before {
content: "\e607";
}
.icon-tuijian:before {
content: "\e610";
}
.icon-bangzhu:before {
content: "\e679";
}
.icon-share:before {
content: "\e656";
}
.icon-yiguoqi:before {
content: "\e997";
}
.icon-shezhi1:before {
content: "\e61d";
}
.icon-fork:before {
content: "\e61b";
}
.icon-kafei:before {
content: "\e66a";
}
.icon-iLinkapp-:before {
content: "\e654";
}
.icon-saomiao:before {
content: "\e60d";
}
.icon-shezhi:before {
content: "\e60f";
}
.icon-shouhoutuikuan:before {
content: "\e631";
}
.icon-gouwuche:before {
content: "\e609";
}
.icon-dizhi:before {
content: "\e614";
}
.icon-fenlei:before {
content: "\e706";
}
.icon-xingxing:before {
content: "\e70b";
}
.icon-tuandui:before {
content: "\e633";
}
.icon-zuanshi:before {
content: "\e615";
}
.icon-zuo:before {
content: "\e63c";
}
.icon-yiguoqi1:before {
content: "\e700";
}
.icon-shoucang2:before {
content: "\e62e";
}
.icon-shouhuodizhi:before {
content: "\e712";
}
.icon-yishouhuo:before {
content: "\e71a";
}
.icon-dianzan-ash:before {
content: "\e617";
}
第二步:挑选相应图标并获取类名,应用于页面:
<text class="yticon icon-xiaoxi"></text>
相关知识补充:CSS3 @font-face 规则
指定名为"myFirstFont"的字体,并指定在哪里可以找到它的URL:
@font-face { font-family: myFirstFont; src: url('Sansation_Light.ttf'), url('Sansation_Light.eot'); /* IE9 */ }
Internet Explorer 9, Firefox, Opera,Chrome, 和 Safari支持@font-face 规则.
但是, Internet Explorer 9 只支持 .eot 类型的字体, Firefox, Chrome, Safari, 和 Opera 支持 .ttf 与.otf 两种类型字体.
注意: Internet Explorer 8 及更早IE版本不支持@font-face 规则.
属性定义及使用说明
font-family:必需的。定义字体的名称。
src:必需的。定义该字体下载的网址(S).[url]加载字体,可以是相对路径,可以是绝对路径,也可以是网络地址。[format]定义的字体的格式,用来帮助浏览器识别。主要取值为:【truetype(.ttf)、opentype(.otf)、truetype-aat、embedded-opentype(.eot)、svg(.svg)、woff(.woff)】。
font-weight:可选。定义字体的粗细。默认值是"正常"
font-style:可选。定义该字体应该是怎样样式。默认值是"正常"
font-stretch:可选。定义该字体应该如何被拉长。默认值是"正常"
@font-face { font-family: <YourDefineFontName>; src: <url> [<format>],[<source> [<format>]], *; [font-weight: <weight>]; [font-style: <style>]; }