Answer the question
In order to leave comments, you need to log in
How to add a class to each array element one by one in vue js 3 using $refs?
I have a block div
.task(v-for='(task, index) in tasks' :key='task.index' :ref="`task${index}`")
.name
| {{task.name}}
.description
| {{task.description1}}
.time
| {{task.time}}
button(class='delete-task' @click="deleteCart(index)") -
mounted () {
this.$refs.task0.classList.add('increase')
this.$refs.task1.classList.add('increase')
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question