main.ts 807 B

123456789101112131415161718192021222324
  1. import { createApp } from 'vue'
  2. import { createPinia } from 'pinia' // 引入 Pinia
  3. import App from './App.vue'
  4. import router from './router' // 引入路由配置
  5. import ElementPlus from 'element-plus'//引入elmplus
  6. import 'element-plus/dist/index.css'
  7. import zhCn from 'element-plus/es/locale/lang/zh-cn' // 导入中文语言包
  8. import * as ElIcons from '@element-plus/icons-vue'
  9. import './style.css'
  10. import './styles/common.scss'
  11. import './styles/element.scss'
  12. const app = createApp(App)
  13. const pinia = createPinia() // 创建实例
  14. Object.keys(ElIcons).forEach((key) => {
  15. app.component(key, (ElIcons as Record<string, any>)[key])
  16. })//ele icon
  17. app.use(ElementPlus, { locale: zhCn })
  18. app.use(pinia) // 使用 Pinia vue3 的状态管理 替代vuex
  19. app.use(router) // 注册路由
  20. app.mount('#app')