import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import { createPinia } from 'pinia';
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import i18n, { elementPlusLocale } from './i18n'

const app = createApp(App);

// 获取当前语言
const currentLocale = localStorage.getItem('language') || 'zh-CN'

app.use(ElementPlus, {
    locale: elementPlusLocale[currentLocale] // 动态配置Element Plus语言
});

app.use(i18n); // 注册 i18n
app.use(createPinia()); // 注册 Pinia
app.use(store); // 注册 store
app.use(router); // 注册 router
app.mount('#app');