From f336487fca7952df00a794bfca73f97bca779f47 Mon Sep 17 00:00:00 2001
From: Coffee-crocodile <1147347984@qq.com>
Date: Fri, 12 Aug 2022 09:28:08 +0800
Subject: [PATCH] =?UTF-8?q?feat(components):=20=E5=A2=9E=E5=8A=A0=E9=BB=91?=
=?UTF-8?q?=E7=99=BD=E6=A8=A1=E5=BC=8F=E5=88=87=E6=8D=A2=E5=8A=9F=E8=83=BD?=
=?UTF-8?q?=E3=80=81=E5=AE=8C=E5=96=84appstore=E7=B1=BB=E5=9E=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/App.vue | 5 +++--
src/store/modules/app.ts | 18 +++++++++++++++++-
2 files changed, 20 insertions(+), 3 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index 447090b..64a9f22 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,10 +1,11 @@
@@ -12,7 +13,7 @@ const themeOverrides: GlobalThemeOverrides = {} || json;
{
+ state: (): AppStatus => {
return {
collapsed: false,
fullScreen: false,
darkMode: false,
+ darkTheme: null,
title: import.meta.env.VITE_APP_TITLE,
footerText: '哲学的基本问题是思维和存在的关系问题',
};
@@ -28,6 +39,11 @@ export const useAppStore = defineStore('app-store', {
/* 切换主题 亮/深色 */
toggleDarkMode() {
this.darkMode = !this.darkMode;
+ if (this.darkMode) {
+ this.darkTheme = darkTheme;
+ } else {
+ this.darkTheme = null;
+ }
},
},
});