|
@@ -1,11 +1,13 @@
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { onMounted } from "vue";
|
|
|
|
|
|
|
+import type { GlobalConfigProvider } from 'tdesign-vue-next';
|
|
|
|
|
|
|
|
-import { usePreferences } from "@vben/preferences";
|
|
|
|
|
-import { merge } from "@vben/utils";
|
|
|
|
|
|
|
+import { onMounted } from 'vue';
|
|
|
|
|
|
|
|
-import { ConfigProvider } from "tdesign-vue-next";
|
|
|
|
|
-import zhConfig from "tdesign-vue-next/es/locale/zh_CN";
|
|
|
|
|
|
|
+import { usePreferences } from '@vben/preferences';
|
|
|
|
|
+
|
|
|
|
|
+import { merge } from 'lodash-es';
|
|
|
|
|
+import { ConfigProvider } from 'tdesign-vue-next';
|
|
|
|
|
+import zhConfig from 'tdesign-vue-next/es/locale/zh_CN';
|
|
|
|
|
|
|
|
defineOptions({ name: 'App' });
|
|
defineOptions({ name: 'App' });
|
|
|
const { isDark } = usePreferences();
|
|
const { isDark } = usePreferences();
|
|
@@ -17,16 +19,17 @@ onMounted(() => {
|
|
|
);
|
|
);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
-const globalConfig = merge(zhConfig, {
|
|
|
|
|
|
|
+const customConfig: GlobalConfigProvider = {
|
|
|
// 可以在此处定义更多自定义配置,具体可配置内容参看 API 文档
|
|
// 可以在此处定义更多自定义配置,具体可配置内容参看 API 文档
|
|
|
calendar: {},
|
|
calendar: {},
|
|
|
table: {},
|
|
table: {},
|
|
|
pagination: {},
|
|
pagination: {},
|
|
|
-});
|
|
|
|
|
|
|
+};
|
|
|
|
|
+const globalConfig = merge(zhConfig, customConfig);
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<ConfigProvider :global-config="globalConfig">
|
|
<ConfigProvider :global-config="globalConfig">
|
|
|
- <RouterView />
|
|
|
|
|
|
|
+ <RouterView />
|
|
|
</ConfigProvider>
|
|
</ConfigProvider>
|
|
|
</template>
|
|
</template>
|