refactor(modules/web): add isDark getters in bookStore.js

This commit is contained in:
Xwite 2024-10-01 17:02:32 +08:00
parent 2ced4b7e1c
commit 312a33aea3
2 changed files with 3 additions and 2 deletions

View File

@ -53,6 +53,7 @@ export const useBookStore = defineStore("book", {
theme: (state) => {
return state.config.theme
},
isDark: (state) => state.config.theme == 6,
},
actions: {
setConnectStatus(connectStatus) {

View File

@ -84,9 +84,9 @@ import { Search } from "@element-plus/icons-vue";
import API from "@api";
const store = useBookStore();
const { connectStatus, connectType, newConnect, shelf, theme } = storeToRefs(store);
const { connectStatus, connectType, newConnect, shelf, isDark } = storeToRefs(store);
const isNight = computed(() => theme.value == 6);
const isNight = computed(() => isDark.value);
const readingRecent = ref({
name: "尚无阅读记录",