From f93a7abe0f155ea31f4d3142afd2e31c8b169eef Mon Sep 17 00:00:00 2001 From: "LINING-PC\\lining" Date: Sat, 7 Feb 2026 19:39:19 +0800 Subject: [PATCH] v1.9.0 - Theme change issue --- src/components/GanttToolbar.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/GanttToolbar.vue b/src/components/GanttToolbar.vue index 9dd2e5c..2dbb07d 100644 --- a/src/components/GanttToolbar.vue +++ b/src/components/GanttToolbar.vue @@ -328,9 +328,12 @@ const closeConfirmDialog = () => { } const handleThemeToggle = () => { - const newTheme = !isDarkMode.value + // v1.9.10 修复:基于 props.theme 而不是内部状态来切换主题 + // 确保与 GanttChart 的 currentThemeMode 保持同步 + const currentTheme = props.theme || (isDarkMode.value ? 'dark' : 'light') + const newTheme = currentTheme === 'dark' ? false : true - // 立即应用主题变化 + // 立即应用主题变化到本地状态(会被 props watch 覆盖,确保同步) isDarkMode.value = newTheme // 不再直接设置document.documentElement,由GanttChart统一管理