From ef585c3f8c2e6a1c6d33403c4aace3218c471384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=A8=9C?= Date: Wed, 4 Jun 2025 11:34:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=B8=BB=E9=A2=98=E5=88=B0if?= =?UTF-8?q?rame?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/dialogue/components/TitleBar.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/views/dialogue/components/TitleBar.vue b/src/views/dialogue/components/TitleBar.vue index 742086a..8f3d6d5 100644 --- a/src/views/dialogue/components/TitleBar.vue +++ b/src/views/dialogue/components/TitleBar.vue @@ -47,7 +47,17 @@ const { theme } = storeToRefs(useChangeThemeStore()); const changeTheme = () => { const { updateTheme } = useChangeThemeStore(); - updateTheme(theme.value === 'light' ? 'dark' : 'light'); + const newTheme = theme.value === 'light' ? 'dark' : 'light'; + updateTheme(newTheme); + // 同步主题到iframe + const iframe = document.querySelector('#my-iframe'); + if (iframe?.contentWindow) { + const data = { + theme: newTheme, + type: 'changeTheme', + }; + iframe.contentWindow.postMessage(data, iframeTarget.value); + } }; const logoutHandler = () => { -- Gitee