zb-admin/src/plugins/ElIcons.ts

16 lines
484 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 注册icon组件
import * as ElIconsModules from '@element-plus/icons-vue'
export const registerElIcons = (app) => {
// 全局注册element-plus icon图标组件
Object.keys(ElIconsModules).forEach((key) => {
//循环遍历组件名称
if ('Menu' !== key) {
//如果不是图标组件不是Menu就跳过否则加上ICon的后缀
app.component(key, ElIconsModules[key])
} else {
app.component(key + 'Icon', ElIconsModules[key])
}
})
}