diff options
author | Santo Cariotti <santo@dcariotti.me> | 2022-09-27 21:49:06 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2022-09-27 21:49:06 +0200 |
commit | 8e5210c6f98670171ac64510451acb1dad691336 (patch) | |
tree | c441217ba6a7a906ee42c32f6eb0acf1a51c04b2 | |
parent | babd0c7cf07f7ef81156d9c272d22e3befc86c1c (diff) |
Use `v-model` to change colormode
-rw-r--r-- | pages/settings.vue | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pages/settings.vue b/pages/settings.vue index 8da18ab..ea1f853 100644 --- a/pages/settings.vue +++ b/pages/settings.vue @@ -61,10 +61,11 @@ .mt-1 select( class="cursor-pointer rounded-md border border-gray-300 bg-white py-2 px-3 text-sm font-medium leading-4 text-gray-700 shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2" + v-model="$colorMode.preference" ) - option(@click="$colorMode.preference = 'system'" :selected="$colorMode.preference == 'system'") System - option(@click="$colorMode.preference = 'light'" :selected="$colorMode.preference == 'light'") Light - option(@click="$colorMode.preference = 'dark'" :selected="$colorMode.preference == 'dark'") Dark + option(value="system" :selected="$colorMode.preference == 'system'") System + option(value="light" :selected="$colorMode.preference == 'light'") Light + option(value="dark" :selected="$colorMode.preference == 'dark'") Dark .py-3.px-4.text-right(class="sm:px-6") |