Ver código fonte

固定 为深色模式

liling 2 semanas atrás
pai
commit
fb68c7b6a1
2 arquivos alterados com 4 adições e 0 exclusões
  1. 3 0
      src/store/modules/settings.js
  2. 1 0
      src/views/index.vue

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

@@ -3,6 +3,8 @@ import { useDark, useToggle } from '@vueuse/core'
 import { useDynamicTitle } from '@/utils/dynamicTitle'
 
 const isDark =  useDark()
+
+if(isDark.value) isDark.value=false; //固定为深色模式
 const toggleDark = useToggle(isDark)
 
 const { sideTheme, showSettings, topNav, tagsView, fixedHeader, sidebarLogo, dynamicTitle } = defaultSettings
@@ -39,6 +41,7 @@ const useSettingsStore = defineStore(
       },
       // 切换暗黑模式
       toggleTheme() {
+        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;