Files
vue-ts-example/src/App.vue
mini2024 295f2d0c95
All checks were successful
/ lint-build-and-check (push) Successful in 2m38s
/ depcheck (push) Successful in 3m7s
/ build-and-deploy-to-vercel (push) Successful in 3m22s
/ playwright (push) Successful in 4m49s
/ surge (push) Successful in 2m36s
feat: 添加主题配置支持并优化 UI 组件页面的暗黑模式样式
2025-03-24 01:19:00 +08:00

24 lines
580 B
Vue

<script setup lang="ts">
import type { ThemeConfig } from 'ant-design-vue/es/config-provider/context';
import { theme } from 'ant-design-vue';
import { useLayout } from './layouts/sakai-vue/composables/layout';
const { isDarkTheme } = useLayout();
const themeConfig = computed(() => {
return {
algorithm: isDarkTheme.value ? theme.darkAlgorithm : theme.defaultAlgorithm,
} satisfies ThemeConfig;
});
</script>
<template>
<a-config-provider :theme="themeConfig">
<RouterView />
</a-config-provider>
<DynamicDialog /> <ConfirmDialog /> <Toast />
</template>