first commit
This commit is contained in:
21
src/utils/iconfont.ts
Normal file
21
src/utils/iconfont.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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')
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user