- 新增主题切换功能,支持浅色、深色和跟随系统三种模式 - 创建主题管理组合式函数 useTheme 和 CSS 变量定义 - 在所有视图组件中应用 CSS 变量以实现主题适配 - 在布局头部添加主题切换按钮,支持循环切换主题 - 更新 .gitignore 添加 .trae 文件忽略
33 lines
499 B
Vue
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>
|