| | |
| | | import router from './router' |
| | | import ElementPlus from 'element-plus' |
| | | import 'element-plus/dist/index.css' |
| | | import zhCn from 'element-plus/dist/locale/zh-cn.mjs' |
| | | import VXETable from 'vxe-table' |
| | | import 'vxe-table/lib/style.css' |
| | | import i18n, { syncElementLocale } from '@/lang'; |
| | | import zhLocale from 'element-plus/dist/locale/zh-cn.mjs'; |
| | | import enLocale from 'element-plus/dist/locale/en.mjs'; |
| | | import i18n ,{syncElementLocale} from '@/lang'; |
| | | // import Echarts from "vue-echarts" |
| | | // echarts.registerMap('china', china) |
| | | // Vue.prototype.$echarts = echarts |
| | |
| | | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { |
| | | app.component(key, component) |
| | | } |
| | | const initElementLocale = () => { |
| | | const currentLang = i18n.global.locale.value; |
| | | return currentLang === 'zh' ? zhLocale : enLocale; |
| | | }; |
| | | |
| | | // 传入初始语言包 |
| | | app.use(ElementPlus, { |
| | | locale: initElementLocale() |
| | | }) |
| | | |
| | | const pinia = createPinia() |
| | | pinia.use(piniaPluginPersistedstate ) |
| | | app.use(VXETable) |
| | | app.use(pinia) |
| | | app.use(router) |
| | | app.use(ElementPlus) |
| | | // app.use(ElementPlus,{ |
| | | // locale: zhCn, |
| | | // }) |
| | | app.use(i18n) |
| | | syncElementLocale(); |
| | | app.mount('#app') |