Rumah >applet WeChat >Pembangunan program mini >浅谈微信小程序中引入并使用自带和外部图标的方法
本篇文章给大家介绍一下微信小程序中自带图标和外部图标的使用方法。有一定的参考价值,有需要的朋友可以参考一下,希望对大家有所帮助。
相关学习推荐:小程序开发教程
自带图标
8f757650f3432f76274b21f6b4c1fc9a e4cd469ff396b3149af5e70eaf7cf674 6246162796bdc0f8628edfb598ad41252eba24e55ed87f3267dcafc828aa9a80 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc成功de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于表示操作顺利完成de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 e4cd469ff396b3149af5e70eaf7cf674 5c10645fd1acd6f2b0939053dfdb40332eba24e55ed87f3267dcafc828aa9a80 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc提示de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于表示信息提示;也常用于缺乏条件的操作拦截,提示用户所需信息de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 e4cd469ff396b3149af5e70eaf7cf674 9f7aaea0a62354a6a8169aba223292852eba24e55ed87f3267dcafc828aa9a80 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc普通警告de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于表示操作后将引起一定后果的情况;也用于表示由于系统原因而造成的负向结果de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 e4cd469ff396b3149af5e70eaf7cf674 e473c801962cbe4ea8750743f72fe2ea2eba24e55ed87f3267dcafc828aa9a80 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc强烈警告de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于表示由于用户原因造成的负向结果;也用于表示操作后将引起不可挽回的严重后果的情况de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 e4cd469ff396b3149af5e70eaf7cf674 1408d0676ea1f3b88393fe630f7b2ee82eba24e55ed87f3267dcafc828aa9a80 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc等待de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于表示等待,告知用户结果需等待de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 e4cd469ff396b3149af5e70eaf7cf674 2835d079eab8e7774b32516e8e35e1eb 56dbf05fdeeb80f592234bb8110bfa012eba24e55ed87f3267dcafc828aa9a80 de5f4c1163741e920c998275338d29b2 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc多选控件图标_已选择de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于多选控件中,表示已选择该项目de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 e4cd469ff396b3149af5e70eaf7cf674 2835d079eab8e7774b32516e8e35e1eb fa74022902a6b9d1ff55d809292eac2c2eba24e55ed87f3267dcafc828aa9a80 de5f4c1163741e920c998275338d29b2 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc多选控件图标_未选择de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于多选控件中,表示该项目可被选择,但还未选择de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 e4cd469ff396b3149af5e70eaf7cf674 2835d079eab8e7774b32516e8e35e1eb d14c1cea5403d597f9f7a233c772b1402eba24e55ed87f3267dcafc828aa9a80 de5f4c1163741e920c998275338d29b2 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc错误提示de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于在表单中表示出现错误de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 e4cd469ff396b3149af5e70eaf7cf674 2835d079eab8e7774b32516e8e35e1eb 19644d3a398f8698bb7ea4c5fbf4de112eba24e55ed87f3267dcafc828aa9a80 de5f4c1163741e920c998275338d29b2 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc单选控件图标_已选择de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于单选控件中,表示已选择该项目de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 e4cd469ff396b3149af5e70eaf7cf674 2835d079eab8e7774b32516e8e35e1eb 6779b39d704a45072eb3d3fa20b80a502eba24e55ed87f3267dcafc828aa9a80 de5f4c1163741e920c998275338d29b2 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc下载de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于表示可下载de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 e4cd469ff396b3149af5e70eaf7cf674 2835d079eab8e7774b32516e8e35e1eb 754ca0f730903b60c85667f3fdca54142eba24e55ed87f3267dcafc828aa9a80 de5f4c1163741e920c998275338d29b2 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc提示de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于在表单中表示有信息提示de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 e4cd469ff396b3149af5e70eaf7cf674 2835d079eab8e7774b32516e8e35e1eb 4a4611760a42b4aab0553892b94c683b2eba24e55ed87f3267dcafc828aa9a80 de5f4c1163741e920c998275338d29b2 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc停止或关闭de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于在表单中,表示关闭或停止de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 e4cd469ff396b3149af5e70eaf7cf674 2835d079eab8e7774b32516e8e35e1eb ac68b9e712abc6280a02aed677f0c1792eba24e55ed87f3267dcafc828aa9a80 de5f4c1163741e920c998275338d29b2 69c5708ad5578add18a9253b733e66a8 0c9af050bcc0c005ad224ed7d65ea5cc搜索de5f4c1163741e920c998275338d29b2 bd0eb3ebb02ee493db7b8a0b0b147b31用于搜索控件中,表示可搜索de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2 de5f4c1163741e920c998275338d29b2
阿里图标库
下载到本地以后,解压出来有一个文件夹,里面有一个文件名字iconfont.css,编辑并复制其中的内容
@font-face {font-family: "iconfont"; src: url('iconfont.eot?t=1537179845858'); /* IE9*/ src: url('iconfont.eot?t=1537179845858#iefix') format('embedded-opentype'), /* IE6-IE8 */ url('data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAArkAAsAAAAAD/gAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFY8d0ofY21hcAAAAYAAAACqAAACPBvG7INnbHlmAAACLAAABkIAAAiQZVCaKmhlYWQAAAhwAAAAMQAAADYT3IeGaGhlYQAACKQAAAAeAAAAJAkRBMBobXR4AAAIxAAAACAAAAAwMx///2xvY2EAAAjkAAAAGgAAABoOLAvybWF4cAAACQAAAAAfAAAAIAEfAHxuYW1lAAAJIAAAAUUAAAJtPlT+fXBvc3QAAApoAAAAfAAAAJvaUUhzeJxjYGRgYOBikGPQYWB0cfMJYeBgYG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2OARNbbYoUGLDns8gaOcZRkyh1jU+dLdo6TwiezCTGmbF3mOSRdemZKR7Mc8kPdaXoUl2d08eKvbThXcSMxaz45Dc6V3BPgCxaIizg==') format('woff'), url('iconfont.ttf?t=1537179845858') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+*/ url('iconfont.svg?t=1537179845858#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-arrow-right:before { content: "\e601"; } .icon-29:before { content: "\e61a"; } .icon-chongzhi:before { content: "\e614"; } .icon-guanyuwomen:before { content: "\e61f"; } .icon-tixian:before { content: "\e649"; } .icon-order-add:before { content: "\e747"; } .icon-option:before { content: "\e60b"; } .icon-guanliyuan:before { content: "\e600"; } .icon-qianbao:before { content: "\e64a"; } .icon-xuanxiang:before { content: "\e7ea"; } .icon-Cash:before { content: "\e611"; }
打开微信开发者工具,找打app.wxss,将刚才复制的内容粘贴至下面
在wxml中引用icon图标,例如引用icon-guanliyuan:before 这是一个管理员图标
<icon class="icon-guanliyuan:before"></icon>
更多编程相关知识,请访问:编程教学!!
Atas ialah kandungan terperinci 浅谈微信小程序中引入并使用自带和外部图标的方法. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!