I am working on a Vue application that retrieves HTML content from an API. This HTML contains blocks with the class
<div class="play-video">...</div>
Using axios to call the API and a promise, I insert the content into the DOM like this:
<div v-if="content" v-html="content"></div>
My concern is how to attach click events to children elements with the .play-video
class. Do I need to monitor changes in the content
property and then use vanilla JS query selectors to bind the events?