1. 阿里巴巴矢量图
- 选择需要的字体修改参数
- 选择SVG下载
2.IcoMoon
3.导入
icomoon
文件夹fonts
文件夹下的所有文件复制到 src/assets/fonts
文件夹下style.css
文件改名为 icomoon.css
, 并复制到 src/assets/fonts
文件夹下@font-face { font-family:'icomoon'; src:url('icomoon.eot?ewmhat'); src:url('icomoon.eot?ewmhat#iefix') format('embedded-opentype'), url('icomoon.ttf?ewmhat')format('truetype'), url('icomoon.woff?ewmhat')format('woff'), url('icomoon.svg?ewmhat#icomoon')format('svg'); font-weight:normal; font-style:normal;}.icomoon{ font-family:"icomoon"!important; font-size:16px; font-style:normal; -webkit-font-smoothing:antialiased; -moz-osx-font-smoothing:grayscale;}
#注册svg,与icomoon.svg文件里的glyph-name对应。
.icon-olivebranch:before{ content:"\e900";}
.icon-recharge:before{ content:"\e901";}
4. 引入
进入 src/main.js
import './assets/fonts/icomoon.css'
5. 使用
<i class="icomoon icon-recharge"></i><i class="icomoon icon-olivebranch" style="font-size:50px;"></i>
效果:
可在样式里设置大小及颜色。