2024-02-23 17:34:31 +01:00
|
|
|
<template>
|
|
|
|
<v-app-bar :elevation="12">
|
2024-02-24 18:07:42 +01:00
|
|
|
<v-app-bar-nav-icon v-on:click="menu = !menu"></v-app-bar-nav-icon>
|
2024-02-24 18:21:23 +01:00
|
|
|
<v-menu v-model="menu" class="menu-below-bar">
|
2024-02-23 17:34:31 +01:00
|
|
|
<v-list>
|
2024-02-24 18:31:30 +01:00
|
|
|
<v-list-item v-for="route in routes" :key="route.name" :to="route.path">{{ route.name }}</v-list-item>
|
2024-02-23 17:34:31 +01:00
|
|
|
</v-list>
|
|
|
|
</v-menu>
|
|
|
|
|
|
|
|
<v-app-bar-title>Brain Blast</v-app-bar-title>
|
|
|
|
|
|
|
|
<template v-slot:append>
|
|
|
|
<v-btn @click="toggleTheme" icon="mdi-theme-light-dark"></v-btn>
|
|
|
|
</template>
|
|
|
|
</v-app-bar>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
2024-02-24 18:07:42 +01:00
|
|
|
import { ref } from 'vue'
|
2024-02-23 17:34:31 +01:00
|
|
|
import { useTheme } from 'vuetify'
|
2024-02-24 18:31:30 +01:00
|
|
|
import { useRouter } from 'vue-router';
|
2024-02-23 17:34:31 +01:00
|
|
|
|
|
|
|
const theme = useTheme()
|
2024-02-24 18:31:30 +01:00
|
|
|
const router = useRouter();
|
|
|
|
const routes = router.options.routes;
|
|
|
|
|
2024-02-24 18:07:42 +01:00
|
|
|
let menu = ref(false)
|
2024-02-23 17:34:31 +01:00
|
|
|
|
|
|
|
function toggleTheme () {
|
|
|
|
theme.global.name.value = theme.global.current.value.dark ? 'light' : 'dark'
|
|
|
|
}
|
2024-02-24 18:07:42 +01:00
|
|
|
|
2024-02-23 17:34:31 +01:00
|
|
|
</script>
|
2024-02-24 18:21:23 +01:00
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.menu-below-bar {
|
|
|
|
margin-top: 48px; /* La hauteur de la barre d'application */
|
|
|
|
}
|
|
|
|
</style>
|