mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
docs(color-mode): fix computed setter logic in ColorModeButton.vue example (#3903)
This commit is contained in:
@@ -26,8 +26,8 @@ const isDark = computed({
|
|||||||
get() {
|
get() {
|
||||||
return colorMode.value === 'dark'
|
return colorMode.value === 'dark'
|
||||||
},
|
},
|
||||||
set() {
|
set(_isDark) {
|
||||||
colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark'
|
colorMode.preference = _isDark ? 'dark' : 'light'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ const isDark = computed({
|
|||||||
get() {
|
get() {
|
||||||
return colorMode.value === 'dark'
|
return colorMode.value === 'dark'
|
||||||
},
|
},
|
||||||
set() {
|
set(_isDark) {
|
||||||
colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark'
|
colorMode.preference = _isDark ? 'dark' : 'light'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user