Files
ndm-web-client/src/stores/theme.ts
yangsy 59a14cb9e1 style
2025-08-25 20:43:27 +08:00

22 lines
445 B
TypeScript

import { ref, computed } from 'vue';
import { defineStore } from 'pinia';
import { darkTheme, lightTheme } from 'naive-ui';
export const useThemeStore = defineStore(
'ndm-theme-store',
() => {
const darkThemeEnabled = ref(true);
const themeMode = computed(() => {
return darkThemeEnabled.value ? darkTheme : lightTheme;
});
return {
darkThemeEnabled,
themeMode,
};
},
{
persist: true,
},
);