//引入createApp用于创建应用 import { createApp } from 'vue' // 引入App根组件 import App from './App.vue' import ElementPlus from 'element-plus' import 'element-plus/dist/index.css' import router from './router' // 全局样式 import '@/styles/index.scss' // 导入语言包 import {createI18n} from 'vue-i18n' import messages from './locales/index' // 引入el图标 import * as ElementPlusIconsVue from '@element-plus/icons-vue' const i18n = createI18n({ legacy: false, locale:localStorage.getItem('lang') || 'en', fallbackLocale: 'en', messages }); const app = createApp(App) // 引入el图标 for (const [key, component] of Object.entries(ElementPlusIconsVue)) { app.component(key, component) } app.use(ElementPlus) app.use(router) app.use(i18n); app.mount('#app')