Files
iot-device-management-frontend/apps/web-tdesign/src/app.vue

36 lines
866 B
Vue
Raw Normal View History

2025-10-21 10:47:39 +08:00
<script lang="ts" setup>
2025-11-06 23:02:24 +08:00
import type { GlobalConfigProvider } from 'tdesign-vue-next';
2025-10-21 10:47:39 +08:00
2025-11-06 23:02:24 +08:00
import { onMounted } from 'vue';
2025-10-21 10:47:39 +08:00
2025-11-06 23:02:24 +08:00
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';
2025-10-21 10:47:39 +08:00
defineOptions({ name: 'App' });
const { isDark } = usePreferences();
2025-10-22 18:14:42 +08:00
onMounted(() => {
document.documentElement.setAttribute(
'theme-mode',
isDark.value ? 'dark' : '',
);
});
2025-10-21 10:47:39 +08:00
2025-11-06 23:02:24 +08:00
const customConfig: GlobalConfigProvider = {
2025-10-22 18:14:42 +08:00
// 可以在此处定义更多自定义配置,具体可配置内容参看 API 文档
calendar: {},
table: {},
pagination: {},
2025-11-06 23:02:24 +08:00
};
const globalConfig = merge(zhConfig, customConfig);
2025-10-21 10:47:39 +08:00
</script>
<template>
2025-10-22 18:14:42 +08:00
<ConfigProvider :global-config="globalConfig">
2025-11-06 23:02:24 +08:00
<RouterView />
2025-10-21 10:47:39 +08:00
</ConfigProvider>
</template>