1. 点到symbol ,然后点击下载到本地![](https://img-blog.csdnimg.cn/direct/e9f8d1d065374188a24bbd9e77166267.png)
2.打开下载的文件夹 ,复制iconfont.js文件到项目中![](https://img-blog.csdnimg.cn/direct/f296ac07e62c46d2a5ed59eb3a65c2a8.png)
![](https://img-blog.csdnimg.cn/direct/8d090fb407ca476791faba674c0c7498.png)
3.下载依赖 :npm i @ant-design/icons
4.在文件夹components下创建icon组件
import { createFromIconfontCN } from '@ant-design/icons';
import { icon } from '../../assets/icon/iconfont'
const IconFont = createFromIconfontCN({
scriptUrl: { icon }
});
export default IconFont;
5.之后在文中引用
import IconFont from '../components/icon/index.js'
<IconFont type="icon-shouye" />
6.启动项目报错
如何解决?
打开iconfont.js文件,在第一行添加 /* eslint-disable */
完美解决!!!!!!!!!!!!