Skip to content

Commit 0f92790

Browse files
committed
fix: 修复了夜间模式跟随系统在初始化时不生效的bug
1 parent ab75a04 commit 0f92790

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

src/App.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { useScrollbarVisibility } from '@/composables/useScrollbarVisibility';
99
import { onMounted } from 'vue';
1010
const uiStore = useUiStore();
1111
onMounted(() => {
12+
uiStore.initTheme();
1213
useScrollbarVisibility();
1314
});
1415
</script>

src/stores/uiStore.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const PANEL_MAX_WIDTH = 600;
88
function uiStore() {
99
const leftPanelWidth = ref(232);
1010
// 深色模式
11-
const isDarkMode = ref(false);
11+
const isDarkMode = ref(detectSystemDark());
1212
const followSystem = ref(true);
1313

1414
function detectSystemDark() {

0 commit comments

Comments
 (0)