main.js 713 B

123456789101112131415161718192021222324252627
  1. import './assets/main.css'
  2. import { createApp } from 'vue'
  3. import App from './App.vue'
  4. import router from './router'
  5. import { createPinia } from 'pinia'
  6. import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'
  7. import * as ElementPlusIconsVue from '@element-plus/icons-vue'
  8. import ElementPlus from 'element-plus'
  9. import zhCn from 'element-plus/es/locale/lang/zh-cn'
  10. const pinia = createPinia()
  11. // pinia数据持久化
  12. pinia.use(piniaPluginPersistedstate)
  13. const app = createApp(App)
  14. for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  15. app.component(key, component)
  16. }
  17. // element-plus语言设置
  18. app.use(ElementPlus, {
  19. locale: zhCn,
  20. })
  21. app.use(router).use(pinia).mount('#app')