Skip to content

Commit

Permalink
fix: fixed closing navbar on links click
Browse files Browse the repository at this point in the history
  • Loading branch information
kouts committed Jun 22, 2024
1 parent 988fd8b commit d95daac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/layouts/default/DefaultNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
to="/"
class="block rounded px-3 py-2 no-underline hover:text-emerald-600 md:bg-transparent md:p-0 md:hover:text-emerald-600"
:active-class="activeClass"
@click="closeNavBar"
>
Home
</router-link>
Expand All @@ -46,6 +47,7 @@
to="/about"
class="block rounded px-3 py-2 no-underline hover:text-emerald-600 md:bg-transparent md:p-0 md:hover:text-emerald-600"
:active-class="activeClass"
@click="closeNavBar"
>
About
</router-link>
Expand All @@ -65,4 +67,8 @@ const activeClass = 'bg-emerald-600 text-white hover:text-white md:!text-emerald
const toggleNavbar = () => {
navbarExpanded.value = !navbarExpanded.value
}
const closeNavBar = () => {
navbarExpanded.value = false
}
</script>

0 comments on commit d95daac

Please sign in to comment.