Skip to content

Commit

Permalink
close mobile menu on route change
Browse files Browse the repository at this point in the history
  • Loading branch information
onmax committed Apr 10, 2024
1 parent b0a4f2c commit 3870488
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .vitepress/theme/components/header/MobileMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ import { DrawerClose, DrawerContent, DrawerOverlay, DrawerPortal, DrawerRoot, Dr
import type { NavigationType } from './navigation-types'
defineProps<{ navigation: NavigationType }>()
const open = ref(false)
const { route } = useRouter()
watch(route, () => open.value = false)
</script>

<template>
<DrawerRoot>
<DrawerRoot v-model:open="open">
<DrawerTrigger v-bind="$attrs">
<div i-nimiq:hamburger-menu rotate-y-180 />
</DrawerTrigger>
Expand Down

0 comments on commit 3870488

Please sign in to comment.