fix: darkMode plugin
This commit is contained in:
+2
-4
@@ -3,12 +3,10 @@ import { reactive } from 'vue';
|
||||
const darkModeMediaQuery = '(prefers-color-scheme: dark)';
|
||||
const matchMedia = window.matchMedia(darkModeMediaQuery);
|
||||
|
||||
const darkMode = reactive({
|
||||
value: matchMedia.matches,
|
||||
});
|
||||
const darkMode = reactive(matchMedia.matches);
|
||||
|
||||
matchMedia.addEventListener('change', (event) => {
|
||||
darkMode.value = event.matches;
|
||||
darkMode = event.matches;
|
||||
});
|
||||
|
||||
export const install = (app) => {
|
||||
|
||||
Reference in New Issue
Block a user