main.js 589 B

123456789101112131415161718192021222324
  1. import { createApp } from 'vue'
  2. import { createPinia } from 'pinia'
  3. import ElementPlus from 'element-plus'
  4. import 'element-plus/dist/index.css'
  5. import * as ElementPlusIconsVue from '@element-plus/icons-vue'
  6. import zhCn from 'element-plus/es/locale/lang/zh-cn'
  7. import App from './App.vue'
  8. import router from './router'
  9. const app = createApp(App)
  10. // 注册所有 Element Plus 图标
  11. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  12. app.component(key, component)
  13. }
  14. app.use(createPinia())
  15. app.use(router)
  16. app.use(ElementPlus, {
  17. locale: zhCn,
  18. })
  19. app.mount('#app')