SoFunction
Updated on 2025-04-04

vue's click event to get the element of the current click

First of all, the click event of vue is bound in html using the @click = "clickfun()" attribute.

Just add the $event parameter to the clicked function

for example

<button @click = “clickfun($event)”>Click</button>
methods: {
clickfun(e) {
// is the element you are currently clicking// It is the element of the event you bind}
},

The above vue click event method to get the current click elements is all the content I share with you. I hope you can give you a reference and I hope you can support me more.