Article reprinted from ： vue+element-ui Use Ali Icon Library in the project
1. Add Icon
First , Find the website of Ali Icon Library ： iconfont
Enter my project
New projects ：
Add an icon to the shopping cart after creating a new item , After you add what you need , Open the shopping cart and add it to the item , Selected items , Can be confirmed .
You can see what you've added 2 An icon , And then click Download to local ：
2. Using icons
- There are many files in the download file , But the main use of these documents , Just delete the others , Leave a few new ones fonts Folder , Add these files to fonts Folder .
2.1 add to fonts
- open vue project , Add it to src In the catalog assets Under the folder ：
2.2 Import fonts Medium iconfonts.css To main.js
2.3 Use it in the page
- After import , Use the icon where you need it ：
<i class="iconfont icon-user"></i>
2.4 Be good at using what it contains demo
- In the downloaded file, there is a demo_index.html The file can easily find the class name of the corresponding icon .