Files
cwd/cwd-admin/src/App.vue
anghunk ba8349b04c feat(admin): 添加深色主题支持
- 新增主题切换功能,支持浅色、深色和跟随系统三种模式
- 创建主题管理组合式函数 useTheme 和 CSS 变量定义
- 在所有视图组件中应用 CSS 变量以实现主题适配
- 在布局头部添加主题切换按钮,支持循环切换主题
- 更新 .gitignore 添加 .trae 文件忽略
2026-01-27 11:07:13 +08:00

33 lines
499 B
Vue

<template>
<div class="app-root">
<router-view />
</div>
</template>
<script setup lang="ts">
import { onMounted } from "vue";
import { useTheme } from "./composables/useTheme";
const { initTheme } = useTheme();
onMounted(() => {
initTheme();
});
</script>
<style>
html,
body,
#app,
.app-root {
height: 100%;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
background-color: var(--bg-body);
color: var(--text-primary);
}
</style>