소스 검색

主题切换

yanghao 1 주 전
부모
커밋
ed3016586a
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/stores/useThemeStore.ts

+ 1 - 1
src/stores/useThemeStore.ts

@@ -5,7 +5,7 @@ import { ref } from "vue";
 export const useThemeStore = defineStore("theme", () => {
   // 默认从 localStorage 读取,如果没有则根据系统偏好或默认 'light'
   const theme = ref<"light" | "dark">(
-    (localStorage.getItem("theme") as "light" | "dark") || "light",
+    (localStorage.getItem("theme") as "light" | "dark") || "dark",
   );
 
   const setTheme = (newTheme: "light" | "dark") => {