radiator-web/src/views/Settings.vue
garionion 1abceb7f2a
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing
add option to toggle dark mode
2021-04-08 15:59:16 +02:00

27 lines
548 B
Vue

<template>
<button
class="bg-green-600 hover:bg-green-400 text-white font-bold py-2 px-4 rounded"
type="button"
@click="toggleDark"
>
Turn Dark Mode {{ isDark ? "off" : "on" }}
</button>
</template>
<script lang="ts">
import { defineComponent } from "vue";
import { useDark, useToggle } from "@vueuse/core";
export default defineComponent({
name: "Settings",
setup() {
const isDark = useDark();
const toggleDark = useToggle(isDark);
return { isDark, toggleDark };
},
});
</script>
<style scoped></style>