uniapp introduces Ali icon library
The use of icons is definitely indispensable for project development. In addition to customizing the icon library, another good thing is to use Ali’s icon library, which contains a lot of classified icons. Basically, it has all the icons you want to use, not only good-looking , It is also very convenient to use, let's take a look below.
1. Official website selection icon
Official website address: https://www.iconfont.cn/
After you enter the official website, you can select the icon you like and add it to your own project. If there is no project, you can create a new one at will. The new icon is first added to the shopping cart, and then added to the project together at that time.
2. Download the file to the local
Click directly to download to the local, and a compressed package containing the style icon file will be downloaded, just unzip it.
3. Install dependencies
The installation dependency here is installed in the way of npm. This dependency library will be used to generate the style execution file later, and this dependency must be installed here.
npm install -g iconfont-tools
或
cnpm install -g iconfont-tools
4. Execution file
Open the command line, enter the downloaded file directory, execute the following command, and then enter as required. (Just look at the options and do it yourself. If you don’t understand it, just do it according to me. I’m here, no accident)
iconfont-tools
5. Use Icons
<view class="t-icon t-icon-dianzan"></view>
dianzan
This is the code of the icon, each icon is different, you can try this yourself.