2021-10-16 16:16:58 +08:00
|
|
|
<template>
|
|
|
|
<el-config-provider :locale="currentLocale">
|
|
|
|
<router-view />
|
|
|
|
</el-config-provider>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
2022-01-21 16:29:23 +08:00
|
|
|
import { defineComponent } from "vue";
|
2021-10-16 16:16:58 +08:00
|
|
|
import { ElConfigProvider } from "element-plus";
|
|
|
|
import zhCn from "element-plus/lib/locale/lang/zh-cn";
|
|
|
|
import en from "element-plus/lib/locale/lang/en";
|
2022-01-21 16:29:23 +08:00
|
|
|
export default defineComponent({
|
2021-10-16 16:16:58 +08:00
|
|
|
name: "app",
|
|
|
|
components: {
|
|
|
|
[ElConfigProvider.name]: ElConfigProvider
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
currentLocale() {
|
2021-11-10 22:12:47 +08:00
|
|
|
return this.$storage.locale?.locale === "zh" ? zhCn : en;
|
2021-10-16 16:16:58 +08:00
|
|
|
}
|
|
|
|
}
|
2022-01-21 16:29:23 +08:00
|
|
|
});
|
2021-10-16 16:16:58 +08:00
|
|
|
</script>
|