From 61997fd1020e823f5c9e0f80a03cbbf6f8d7e59a Mon Sep 17 00:00:00 2001 From: pany <939630029@qq.com> Date: Mon, 25 Nov 2024 10:19:15 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=20ThemeSwitch=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ThemeSwitch/index.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/components/ThemeSwitch/index.vue b/src/components/ThemeSwitch/index.vue index 1c65d009..ce5dcbbd 100644 --- a/src/components/ThemeSwitch/index.vue +++ b/src/components/ThemeSwitch/index.vue @@ -14,9 +14,7 @@ function handleChangeTheme({ clientX, clientY }: MouseEvent, themeName: ThemeNam style.setProperty("--v3-theme-x", `${clientX}px`) style.setProperty("--v3-theme-y", `${clientY}px`) style.setProperty("--v3-theme-r", `${maxRadius}px`) - const handler = () => { - setTheme(themeName) - } + const handler = () => setTheme(themeName) document.startViewTransition ? document.startViewTransition(handler) : handler() }