mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-21 23:36:15 -04:00
fix(style): working dark mode persistence
This commit is contained in:
parent
765c010700
commit
3ae872847b
1 changed files with 4 additions and 8 deletions
|
@ -1,13 +1,9 @@
|
|||
import { useStorage, usePreferredDark } from '@vueuse/core';
|
||||
import { useStorage } from '@vueuse/core';
|
||||
import { defineStore } from 'pinia';
|
||||
import type { Ref } from 'vue';
|
||||
|
||||
export const useStyleStore = defineStore('style', {
|
||||
state: () => {
|
||||
const isDark = usePreferredDark();
|
||||
|
||||
return {
|
||||
isDarkTheme: useStorage('useDarkTheme', isDark) as Ref<boolean>,
|
||||
};
|
||||
},
|
||||
state: () => ({
|
||||
isDarkTheme: useStorage('useDarkTheme', false) as Ref<boolean>,
|
||||
}),
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue