feat: 添加主题配置支持并优化 UI 组件页面的暗黑模式样式
This commit is contained in:
20
src/App.vue
20
src/App.vue
@ -1,5 +1,23 @@
|
||||
<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>
|
||||
<RouterView />
|
||||
<a-config-provider :theme="themeConfig">
|
||||
<RouterView />
|
||||
</a-config-provider>
|
||||
|
||||
<DynamicDialog /> <ConfirmDialog /> <Toast />
|
||||
</template>
|
||||
|
Reference in New Issue
Block a user