How to Close Sidebar on Item Click (mobile) ? #960
Unanswered
reksamamur
asked this question in
Q&A
Replies: 1 comment 1 reply
-
What I ended up doing was adding the following to Sidebar.vue defineExpose({
isMobile,
setOpenMobile,
}) and then on my layout page <Sidebar ref="sidebarRef">
<!-- other code -->
<NuxtLink :to="item.href" @click="sidebarRef?.isMobile ? sidebarRef?.setOpenMobile(false) : null">
<Icon :name="item.icon" class="flex-shrink-0 w-5 h-5 mr-2" /> {{ item.name }}
</NuxtLink> |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, hopping someone can help.
I can't seem to find work around on it, tried using
useSidebar()
but got error injection.Beta Was this translation helpful? Give feedback.
All reactions