Files
admin-govern/src/utils/iconfont.ts

22 lines
617 B
TypeScript
Raw Normal View History

2023-12-21 16:42:39 +08:00
import { nextTick } from 'vue'
import * as elIcons from '@element-plus/icons-vue'
/*
* element plus
*/
export function getElementPlusIconfontNames() {
return new Promise<string[]>((resolve, reject) => {
nextTick(() => {
const iconfonts = []
const icons = elIcons as any
for (const i in icons) {
iconfonts.push(`el-icon-${icons[i].name}`)
}
if (iconfonts.length > 0) {
resolve(iconfonts)
} else {
reject('No ElementPlus Icons')
}
})
})
}