Toggle between Dropdown components #9856
Unanswered
l0n3s0m3-w0lf13
asked this question in
Help/Questions
Replies: 1 comment
-
Plan A: The simplest method is |
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.
-
Hewo! 🐺 I've recently ventured into Vue and successfully created a Dropdown component using the Composition API with <script setup>. Everything seems to be working smoothly when clicking outside the element due to the use of refs and event listeners to detect clicks within the component.
The thing is that, when creating several instances of the same component, all of them share the same reactivity, so what I'm trying to achieve is getting a single dropdown component opened at the same time, therefore when I open a new dropdown component, I need the one that's already opened to close down. How could I do this, does anyone know how to get there? Thanks 💟
I'll share the code below:
and using it like so:
Beta Was this translation helpful? Give feedback.
All reactions