feat(Nav): add dark mode btn

This commit is contained in:
thehrz 2023-07-11 15:39:05 +08:00
parent 94f1c42a4e
commit 91d1bb45e6
No known key found for this signature in database
GPG Key ID: 683658B4CAC43158

View File

@ -1,26 +1,47 @@
<script lang="ts"> <script lang="ts" setup>
export default { // export default {
data: () => ({ // data: () => ({
pages: [ // pages: [
{ // {
title: '教师', // title: '',
page: '/teachers', // page: '/teachers',
}, // },
{ // {
title: '事件', // title: '',
page: '/events', // page: '/events',
}, // },
{ // {
title: '文章', // title: '',
page: '/posts', // page: '/posts',
}, // },
{ // {
title: '关于', // title: '',
page: '/about', // page: '/about',
}, // },
], // ],
}), // }),
} // }
const pages = [
{
title: '教师',
page: '/teachers',
},
{
title: '事件',
page: '/events',
},
{
title: '文章',
page: '/posts',
},
{
title: '关于',
page: '/about',
},
]
const { t } = useI18n()
</script> </script>
<template> <template>
@ -41,6 +62,11 @@ export default {
<v-spacer /> <v-spacer />
<v-btn
class="mx-2" :title="t('button.toggle_dark')" :icon="isDark ? 'mdi-weather-night' : 'mdi-weather-sunny'"
@click="toggleDark()"
/>
<v-menu> <v-menu>
<template #activator="{ props }"> <template #activator="{ props }">
<v-app-bar-nav-icon v-bind="props" class="md:hidden!" /> <v-app-bar-nav-icon v-bind="props" class="md:hidden!" />