其他分享
首页 > 其他分享> > 注册全局图标ts写法

注册全局图标ts写法

作者:互联网

https://element-plus.gitee.io/zh-CN/component/icon.html#使用图标

仓库地址:https://github.com/Megasu/element-plus-icons

注册所有图标

您需要从 @element-plus/icons-vue 中导入所有图标并进行全局注册。

// main.ts

// 如果您正在使用CDN引入,请删除下面一行。
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

标签:icons,app,component,ts,element,plus,写法,图标
来源: https://www.cnblogs.com/Megasu/p/16300537.html