How to Close Sidebar on Item Click (mobile) ? #960
Unanswered
reksamamur
asked this question in
Q&A
Replies: 2 comments 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
-
|
Hi, i just started a discussion on this topic and found your question. Have a look at my discussion. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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