Vuejs and event deligation

Hi,

I have a vue app and a functional is called on a click events. There are 2 image and the first one is deleted (with Jquery .remove()) and a new one is added.

I target the first image using img:nth-child(1), however after I remove it and try to target the new img:nth-child(1) it is does not exist.

With jquery I think I use event delegation to solve this

https://learn.jquery.com/events/event-delegation/

“Event delegation refers to the process of using event propagation (bubbling) to handle events at a higher level in the DOM than the element on which the event originated. It allows us to attach a single event listener for elements that exist now or in the future.”

Can this be done with vue JS?

I believe it can be done. Check out this response: Is event delegation necessary? as well as: https://recursive.codes/blog/post/34