整合主题管理器,优化主题切换逻辑

This commit is contained in:
jxxghp
2025-07-25 13:39:10 +08:00
parent cf72b2cdb9
commit f36c1bd2b5
6 changed files with 450 additions and 215 deletions

View File

@@ -11,6 +11,7 @@ import { preloadImage } from './@core/utils/image'
import { globalLoadingStateManager } from '@/utils/loadingStateManager'
import { addBackgroundTimer, removeBackgroundTimer } from '@/utils/backgroundManager'
import PWAInstallPrompt from '@/components/PWAInstallPrompt.vue'
import { themeManager } from '@/utils/themeManager'
// 生效主题
const { global: globalTheme } = useTheme()
@@ -212,6 +213,9 @@ onMounted(async () => {
// 初始化data-theme属性
updateHtmlThemeAttribute(globalTheme.name.value)
// 初始化主题管理器 - 统一处理主题初始化
await themeManager.setTheme(themeValue)
// 监听主题变化
watch(
() => globalTheme.name.value,