BrainBlast/src/components/BrainBlastBar.vue

28 lines
694 B
Vue
Raw Normal View History

2024-02-23 17:34:31 +01:00
<template>
<v-app-bar :elevation="12">
<RouterMenu />
2024-02-23 17:34:31 +01:00
<v-app-bar-title>Brain Blast</v-app-bar-title>
<template v-slot:append>
<v-btn icon @click="toggleTheme">
<v-icon>{{ darkTheme ? 'mdi-white-balance-sunny' : 'mdi-moon-waning-crescent' }}</v-icon>
</v-btn>
2024-02-23 17:34:31 +01:00
</template>
</v-app-bar>
</template>
<script setup>
import { ref } from 'vue'
2024-02-23 17:34:31 +01:00
import { useTheme } from 'vuetify'
import RouterMenu from '@/components/RouterMenu.vue'
2024-02-23 17:34:31 +01:00
const theme = useTheme()
const darkTheme = ref(true)
2024-02-23 17:34:31 +01:00
function toggleTheme() {
darkTheme.value = !darkTheme.value
2024-02-23 17:34:31 +01:00
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
}
2024-02-23 17:34:31 +01:00
</script>