elementPlus使用el-icon

按着文档来撒
yarn add @element-plus/icons-vue

main.ts

  import * as ElementIcons from '@element-plus/icons-vue'

  for (const key in ElementIcons) {
  	app.component(key, (ElementIcons as any)[key])
  }

单独用的时候
<el-icon><eleme /></el-icon>

传入变量名用
<el-icon><component :is="menu.meta?.icon"></component></el-icon>


新框架边搭边玩搞了几天,今天和设计沟通的时候,建议我用TDesign,说比elementUI要好看,他也会按着TD的来设计
至此,我去踩TD的坑了,趁着换插件前写点东西记录一下 菜单项篇切换主题篇icon引入篇
拜拜了

posted @ 2022-04-25 15:36  大禹不治水  阅读(925)  评论(0编辑  收藏  举报