VueJS – Prevent Default on link click but also capture object

Alternatively, in Vue 1.x, you could also use the event modifier .prevent:

HTML:

<a v-on:click.prevent="showResponder(responder)">...</a>

You could stop propagation as well:

<a v-on:click.prevent.stop="showResponder(responder)">...</a>

JS:

...
            showResponder: function(responder)
            {
                // No need to prevent any more
                this.activeResponder = responder;
            }
...

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)