main.js 669 B

123456789101112131415161718192021222324252627
  1. import { createApp } from 'vue'
  2. import { createPinia } from 'pinia'
  3. import ElementPlus from 'element-plus'
  4. import * as ElementPlusIconsVue from '@element-plus/icons-vue'
  5. import 'element-plus/dist/index.css'
  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. // 注册 Pinia
  11. app.use(createPinia())
  12. // 注册 Vue Router
  13. app.use(router)
  14. // 注册 Element Plus(中文语言包)
  15. app.use(ElementPlus, { locale: zhCn })
  16. // 注册所有 Element Plus 图标
  17. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  18. app.component(key, component)
  19. }
  20. app.mount('#app')