头图

add icon

Open, https://www.iconfont.cn/ website, find your favorite chart and add it to the project

image.png

download local

Click to download to local

image.png

copy file

Copy iconfont.css , iconfont.woff , iconfont.woff2 to your own project,

Open the iconfont.css file, where I need to go to edit the box

image.png

resource conversion

uni-app font file is less than 40kb, uni-app will automatically convert it to base64 format
uni-app local path icon font support: the font file is greater than or equal to 40kb, and the developer needs to convert it, otherwise the use will not take effect
conversion tool

https://www.giftofspeed.com/base64-encoder/

Open the conversion tool website, select iconfont.ttf font to convert

image.png

Copy the content, go back to the code

image.png

Effect

browser side

image.png

App side

40237ee7d9cce800df82bd318b94956.jpg


羊先生
1.9k 声望821 粉丝