Answer the question
In order to leave comments, you need to log in
How to form a class in a loop by condition in vue?
It is necessary in the loop for elements for which a certain condition is met (in this case, for elements from the 3rd to the end) to form a class, that is, I want something like the following, but this option does not work, swears at an unexpected token +
<div v-for="(t1,i1) in array1">
<div v-for="(t2,i2) in array2">
<div :class="{'cls'+'_'+i1:i2>2}">{{t2}}</div>
</div>
</div>
<div>
<div>
<div>aa</div>
</div>
<div>
<div>bb</div>
</div>
<div>
<div class="cls_0">cc</div>
</div>
<div>
<div class="cls_0">dd</div>
</div>
</div>
<div>
<div>
<div>aaa</div>
</div>
<div>
<div>bbb</div>
</div>
<div>
<div class="cls_1">ccc</div>
</div>
<div>
<div class="cls_1">ddc</div>
</div>
</div>
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