Try x-on:click. I had this issue when i had vue installed alongside alpine, there was a conflict of directives
Jul 5, 2021
5
Level 4
Alpine.js: button using @click function not working.
Hi, I'm currently trying to use alpine.js to open a slide out menu utilising x-data="{}", x-show="", and @click="". I've narrowed down the issue to the button I have the @click="" on not actually working. I believe the issue could be that this button is within a different x-show="" element, as I've tried it on a button outside the x-show="" and it's worked. I guess what I'm asking is can you have @click="" functions inside an existing x-show="" element (e.g., a button within a drop down).
Please or to participate in this conversation.