fix: register Element Plus icons globally

- Import and register all @element-plus/icons-vue
- Fixes icons showing as squares/rectangles
This commit is contained in:
2026-07-04 19:54:34 +08:00
parent 4075f20c07
commit b9d64ed851
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -3,6 +3,7 @@ import { createApp } from 'vue'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import App from './App.vue'
import router from './router'
import './styles/global.css'
@@ -11,4 +12,9 @@ const app = createApp(App)
app.use(createPinia())
app.use(router)
app.use(ElementPlus, { size: 'small' })
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component(key, component)
}
app.mount('#app')