Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

@click event not firing on nuxt-link in Nuxt 3

According to this Nuxt 2 stack question this should prevent nuxt-link from navigating to a new page:

<nuxt-link :to="`/meet`" class="group font-normal" @click.native="event => event.preventDefault()" event="">

but it doesn’t. The function inside @click is not executed and nuxt navigates to /meet url.

Any idea how to execute @click events on a nuxt 3 link?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Try to use the prevent modifier :

<nuxt-link :to="`/meet`" class="group font-normal" @click.prevent="yourEventHandler" event="">
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading