diff --git a/docs/content/1.getting-started/6.color-mode/1.nuxt.md b/docs/content/1.getting-started/6.color-mode/1.nuxt.md index e4a07514..35e6d68d 100644 --- a/docs/content/1.getting-started/6.color-mode/1.nuxt.md +++ b/docs/content/1.getting-started/6.color-mode/1.nuxt.md @@ -26,8 +26,8 @@ const isDark = computed({ get() { return colorMode.value === 'dark' }, - set() { - colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark' + set(_isDark) { + colorMode.preference = _isDark ? 'dark' : 'light' } }) diff --git a/playground/app/app.vue b/playground/app/app.vue index 5557d7e1..b73b4437 100644 --- a/playground/app/app.vue +++ b/playground/app/app.vue @@ -10,8 +10,8 @@ const isDark = computed({ get() { return colorMode.value === 'dark' }, - set() { - colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark' + set(_isDark) { + colorMode.preference = _isDark ? 'dark' : 'light' } })