The data obtained by vue from the background is rendered in a multi-layer loop on the page. Click on a value to add a background color to the corresponding value.

question:
1. Set all values in the page to be unselected (background color is gray)

clipboard.png

2.Ab
clipboard.png

corresponding code (there is related code in this link)
https://jsfiddle.net/xiyanzi/.

the passing gods come in and have a look

Dec.31,2021

it is certainly not possible for all your loops to be judged by the same index . index is the number of 1 times N , which is bound to be repeated.
your code can be identified directly with the values of the array

 <span
     v-for="(j, index2) in i.data"
     :key="j"
     :class="{'active': tabIndex == j}"
     @click="select(j)">
  {{ j }}
</span>

of course, it's possible to use index if the cache objects of each loop are different, but the multi-selection effect may not be the
add multi-key cache to your code

.

pass in letter, and use letter to make a judgment
https://jsfiddle.net/fo608vy5/

.
Menu