How can I extract the expression within the template that is contained in :class
?
<div
v-for="(user, index) in users"
:key="index"
:class="{'bg-yellow-lighter': infoWindowMarker &&
infoWindowMarker.position.lat === user.position.lat &&
infoWindowMarker.position.lng === user.position.lng}"
>
// more HTML here
</div>
I've considered using a computed
property but it seems like it's not feasible due to the v-for
looping over the array.
Is there another way to achieve this or should I consider writing a method
and passing user
to it?