I have a list rendering using the v-for directive in Vue.js.
<li v-for="group in groupList" :key="group.id" @dragenter="toggleClass ...."@dragleave="toggleClass ...." >
Content
</li>
My goal is to apply a class to the li
element when the dragenter
event occurs. How can I achieve this? How do I access the element itself (not just its data) inside the event handler, and how can I toggle the class based on that reference?
While I understand that Vue promotes data-driven changes to reflect on the DOM, I am looking for a more concise solution that doesn't rely on indexes or IDs within the data model. Thank you.