Skip to content

Commit

Permalink
feat(Mobile Navbar): ⚡ Lazy Load Mobile Sidebar Navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
bKoZii committed Sep 14, 2024
1 parent 5750cb7 commit c57d366
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions components/Navbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<UDivider orientation="vertical" class="hidden md:block" />
<NavbarThemeSwitch />
<UButton class="inline-flex md:hidden" aria-label="Open" icon="ph:list" variant="ghost" color="black" @click="isSidebarOpen = true" />
<USlideover v-model="isSidebarOpen">
<LazyUSlideover v-model="isSidebarOpen">
<div class="flex flex-1 flex-col gap-3 p-4">
<div class="flex flex-row items-center justify-between">
<ULink id="myName" to="/" class="inline-flex items-center gap-1 text-2xl font-extrabold" aria-label="logo">
Expand All @@ -43,13 +43,13 @@
/>
</div>
<UDivider />
<UVerticalNavigation
<LazyUVerticalNavigation
:links="navItems"
:ui="{ active: 'text-primary dark:text-primary', icon: { active: 'text-primary dark:text-primary' } }"
@click="isSidebarOpen = false"
/>
</div>
</USlideover>
</LazyUSlideover>
</nav>
</header>
</div>
Expand Down Expand Up @@ -87,6 +87,11 @@ const navItems = [
label: 'Blog',
to: '/blog',
icon: 'ph:book-duotone'
},
{
label: 'Search Test',
to: '/searchTest',
icon: 'ph:magnifying-glass-duotone'
}
]
</script>

0 comments on commit c57d366

Please sign in to comment.