Vue asks how the v-for loop array makes some of the elements contained in the array show dynamic styles.

Select a module push two values to an array

clipboard.png
;

datareturnresarray[];

clipboard.png
v-for:

clipboard.png
idresarrayid

clipboard.png
ask for advice

Mar.13,2021

write to each column in the circular array arr add an attribute isClick: false, to the click event of each list to pass the index index as a parameter, and click the event to get the index. Then change the isClick attribute in the corresponding list: arr [index] .isClick = true, and then make a judgment in html: class= "{item.isClick? 'active':'}}"


your code is incomplete. How do you think

?
Menu