App.vue 566 B

1234567891011121314151617181920212223
  1. <template>
  2. <el-config-provider :locale="currentLocale">
  3. <router-view />
  4. </el-config-provider>
  5. </template>
  6. <script lang="ts">
  7. import { defineComponent } from "vue";
  8. import { ElConfigProvider } from "element-plus";
  9. import zhCn from "element-plus/lib/locale/lang/zh-cn";
  10. import en from "element-plus/lib/locale/lang/en";
  11. export default defineComponent({
  12. name: "app",
  13. components: {
  14. [ElConfigProvider.name]: ElConfigProvider
  15. },
  16. computed: {
  17. currentLocale() {
  18. return this.$storage.locale?.locale === "zh" ? zhCn : en;
  19. }
  20. }
  21. });
  22. </script>