Answer the question
In order to leave comments, you need to log in
How to determine which element is in an array?
I have an Articles object and an array of ids
I render the Articles as
<articles v-for="article in articles">
<span> {{article.id}} </span>
</articles>
ids.includes('article.id')
Answer the question
In order to leave comments, you need to log in
<span :class="{'my-class': ids.includes(article.id)}"> {{article.id}} </span>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question