1.先将需要的图标添加到仓库
2.点击下载到本地
3.将压缩包解压出来
4.将iconfont.css和iconfont.ttf文件复制到你的项目中的static的文件夹中
5.修改iconfont.css文件中@font-face对象的src路径
@font-face {
font-family: "iconfont";
src:url('/static/iconfont.ttf') format('truetype');
}
6.在App.vue进行全局引入
<style lang="scss">
@import "@/static/iconfont.css";
</style>
7.使用
<uni-icons custom-prefix="iconfont" type="icon-shouye1" size="30"></uni-icons>
说明:custom-prefix是iconfont.css中的font-family的值,一般默认是iconfont,type是你需要引入的图标名称