From 9bef390fb00ced0583d18192dc6dc2047fd72363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=AE=E5=8F=AE=E5=BD=93?= <604054726@qq.com> Date: Sat, 5 Aug 2023 16:21:13 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=88=9D=E5=A7=8B=E5=8C=96=E6=97=B6?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E8=83=8C=E6=99=AF=E8=89=B2=E7=9A=84=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/@core/components/ThemeSwitcher.vue | 8 +++++--- src/App.vue | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/@core/components/ThemeSwitcher.vue b/src/@core/components/ThemeSwitcher.vue index 641adec0..fe6103b7 100644 --- a/src/@core/components/ThemeSwitcher.vue +++ b/src/@core/components/ThemeSwitcher.vue @@ -26,6 +26,8 @@ function changeTheme() { globalTheme.name.value = nextTheme savedTheme.value = nextTheme localStorage.setItem('theme', nextTheme) + // 修改载入时背景色 + localStorage.setItem('materio-initial-loader-bg', globalTheme.current.value.colors.background) themeTransition() } @@ -39,9 +41,9 @@ watch( ) // Apply saved theme on page load -onMounted(() => { - globalTheme.name.value = savedTheme.value -}) +// onMounted(() => { +// globalTheme.name.value = savedTheme.value +// }) function hasScrollbar(el?: Element | null) { if (!el || el.nodeType !== Node.ELEMENT_NODE) diff --git a/src/App.vue b/src/App.vue index cbd0d332..b5ca8823 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,10 +1,15 @@