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

33 lines
750 B
Vue
Raw Normal View History

2025-10-21 10:47:39 +08:00
<script lang="ts" setup>
2025-10-22 18:14:42 +08:00
import { onMounted } from "vue";
2025-10-21 10:47:39 +08:00
2025-10-22 18:14:42 +08:00
import { usePreferences } from "@vben/preferences";
import { merge } from "@vben/utils";
2025-10-21 10:47:39 +08:00
2025-10-22 18:14:42 +08:00
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-10-22 18:14:42 +08:00
const globalConfig = merge(zhConfig, {
// 可以在此处定义更多自定义配置,具体可配置内容参看 API 文档
calendar: {},
table: {},
pagination: {},
2025-10-21 10:47:39 +08:00
});
</script>
<template>
2025-10-22 18:14:42 +08:00
<ConfigProvider :global-config="globalConfig">
2025-10-21 10:47:39 +08:00
<RouterView />
</ConfigProvider>
</template>