I'm trying add a class to the correct answer. This code works, but when the key 'acertou' is true, CSS class 'certa' applies to all the li elements.
How can I add this class only to the li that was actually clicked?
<div class="alternativas">
<ul>
<li
v-for="alternativa in perguntaAtual.alternativas"
:key="alternativa"
@click="corrige(alternativa, perguntaAtual)"
:class="{ certa: acertou }"
>
{{ alternativa }}
</li>
</ul>
</div>
acertou) for all elements. Try to use unique identifier.