2 Commits 490eaf8cb7 ... f25e5ad354

Author SHA1 Message Date
  liling f25e5ad354 Merge branch 'master' of http://94.191.59.107:3000/wukai/warehouse-ui 2 weeks ago
  liling fb68c7b6a1 固定 为深色模式 2 weeks ago
2 changed files with 4 additions and 3 deletions
  1. 3 3
      src/store/modules/settings.js
  2. 1 0
      src/views/index.vue

+ 3 - 3
src/store/modules/settings.js

@@ -3,8 +3,7 @@ import { useDark, useToggle } from '@vueuse/core'
 import { useDynamicTitle } from '@/utils/dynamicTitle'
 
 const isDark =  useDark()
-//默认暗黑模式
-isDark.value=true;
+if(isDark.value) isDark.value=false; //固定为深色模式
 const toggleDark = useToggle(isDark)
 
 const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings
@@ -40,7 +39,8 @@ const useSettingsStore = defineStore(
       },
       // 切换暗黑模式
       toggleTheme() {
-        this.isDark = !this.isDark
+        if(this.isDark.value) return //深色模式时不切换,保持深色模式
+        this.isDark = !this.isDark 
         toggleDark()
       }
     }

+ 1 - 0
src/views/index.vue

@@ -861,6 +861,7 @@ onMounted(() => {
     width: 100%;
     height: calc(100vh - 60px);
     position: relative;
+    background-color: rgb(42, 42, 42) !important;
     .alarm_list{
       position: absolute;
       z-index: 10;