Element Plus 团队表示正在将原有组件内的 Font Icon 向 SVG Icon 迁移,正式版本Font Icon将被弃用,于是目标是对代码进行对应的更新,Font Icon换成SVG Icon。
文档: Icon 图标 | Element Plus (element-plus.org) (2021.10.12更新替换连接地址,element-plus文档网址变动了)
注意:当前图标只适用于vue3。
前排提示(2021.12.13更新):根据[email protected]版本的更新日志,连接:更新日志 | Element Plus (gitee.io)。原@element-plus/icons(已废弃)改为@element-plus/icons-vue,所以本文依赖包使用2021.12.13时最新版本[email protected]和@element-plus/[email protected],并且所有导入已修改,@element-plus/icons改为@element-plus/icons-vue即可。图标使用时如无显示,请注意命名格式、作为属性传输时是String还是Component类型。具体修改如下:
// 将 import * as ElIconModules from '@element-plus/icons' 修改为
import * as ElIconModules from '@element-plus/icons-vue'
// 将 import { Edit } from '@element-plus/icons' 修