Is there a way in Vue.js to dynamically toggle a class on a click
event for a div without relying on properties or data?
Take a look at this div:
<div class="quiz-item" @click="checkAnswer(1)">
Upon clicking this div
, I want to add either the class quiz-item--correct
or quiz-item--incorrect
(with the actual logic handled elsewhere). Since the quiz has numerous answers, using properties is not a feasible or efficient solution.
Any suggestions on how to achieve this functionality?