init
This commit is contained in:
23
pc/plugins/icons.ts
Normal file
23
pc/plugins/icons.ts
Normal file
@ -0,0 +1,23 @@
|
||||
import * as ElementPlusIcons from '@element-plus/icons-vue'
|
||||
//@ts-ignore
|
||||
const localIconsName: string[] = []
|
||||
|
||||
export const LOCAL_ICON_PREFIX = 'local-icon-'
|
||||
export const EL_ICON_PREFIX = 'el-icon-'
|
||||
|
||||
const elIconsName: string[] = []
|
||||
|
||||
export function getElementPlusIconNames() {
|
||||
return elIconsName
|
||||
}
|
||||
export function getLocalIconNames() {
|
||||
return localIconsName
|
||||
}
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
for (const [iconName, component] of Object.entries(ElementPlusIcons)) {
|
||||
const componentName = `${EL_ICON_PREFIX}${iconName}`
|
||||
elIconsName.push(componentName)
|
||||
nuxtApp.vueApp.component(componentName, component)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user