|
@@ -0,0 +1,30 @@
|
|
|
|
+<script setup lang="ts">
|
|
|
|
+import { computed } from 'vue';
|
|
|
|
+import { useI18n } from 'vue-i18n';
|
|
|
|
+import enUS from 'ant-design-vue/es/locale/en_US';
|
|
|
|
+import zhCN from 'ant-design-vue/es/locale/zh_CN';
|
|
|
|
+
|
|
|
|
+import { LanguageType } from '@/constants';
|
|
|
|
+
|
|
|
|
+import type { ThemeConfig } from 'ant-design-vue/es/config-provider/context';
|
|
|
|
+
|
|
|
|
+import 'dayjs/locale/zh-cn';
|
|
|
|
+
|
|
|
|
+const { locale: language } = useI18n();
|
|
|
|
+
|
|
|
|
+const theme: ThemeConfig = {
|
|
|
|
+ token: {
|
|
|
|
+ colorPrimary: '#32BAC0',
|
|
|
|
+ },
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const locale = computed(() => {
|
|
|
|
+ return language.value === LanguageType.ZH ? zhCN : enUS;
|
|
|
|
+});
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<template>
|
|
|
|
+ <AConfigProvider :theme="theme" :locale="locale">
|
|
|
|
+ <slot></slot>
|
|
|
|
+ </AConfigProvider>
|
|
|
|
+</template>
|