1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-20 08:49:16 +08:00
1Panel/frontend/src/App.vue

30 lines
834 B
Vue
Raw Normal View History

2022-08-16 23:30:23 +08:00
<template>
<el-config-provider :locale="i18nLocale" :button="config" :size="assemblySize">
<router-view></router-view>
</el-config-provider>
</template>
<script setup lang="ts">
import { reactive, computed } from 'vue';
import { GlobalStore } from '@/store';
import zhCn from 'element-plus/es/locale/lang/zh-cn';
import en from 'element-plus/es/locale/lang/en';
import { useTheme } from '@/hooks/use-theme';
useTheme();
const globalStore = GlobalStore();
const config = reactive({
autoInsertSpace: false,
});
const i18nLocale = computed((): any => {
if (globalStore.language && globalStore.language == 'zh') return zhCn;
if (globalStore.language == 'en') return en;
return '';
});
const assemblySize = computed((): string => globalStore.assemblySize);
</script>
<style scoped lang="scss"></style>