[Vuejs]-Return the element that called the event listener in Nuxt

0👍

I’ve tested this code based on your question and it works fine for me.

You should pass the event parameter to the switchItOn and use event.target.parentNode as the selector.

switchItOn: function(event) {
 console.log(event.target.parentNode)
},

If you’re interested in this property, you can read about it here

Leave a comment