Consider the following HTML:
<template v-for="(child, index) in group">
<div :class="{'border-pink-700 bg-gray-100 ': selected === child.id}">
<div>Container Content</div>
</div>
</template>
Is there a method to externalize the class binding from the HTML while still relying on a condition passed via the v-for
loop (child.id
)?
Although the documentation mentions the possibility of binding computed properties, it seems that they do not accept arguments. I have attempted this approach without success.