How with alpine to make accordion with only 1 item opened? #691
sergeynilov
started this conversation in
4. General
Replies: 2 comments 1 reply
-
You could fire an event on the window that closes all others when clicked. <div @close-all-faq.stop.window="close()" @click="$dispatch('close-all-faq', '');close()"> |
Beta Was this translation helpful? Give feedback.
0 replies
-
You could also move x-data to the parent and store the faq id instead of a boolean. |
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
-
Hello,
In laravel 7 with livewire 1.3 and [email protected] I made accordion like :
and it works, but how can I make with alpine to have opened only 1 item?
If user clicks on some other items, the rest of items must be closed...
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions