[Vuejs]-Vue v-for loop click event affecting all items

-1šŸ‘

Reason for your problem is
:class="[copied === true ? ā€˜copiedā€™ : ā€]". SInce when you click any copy button, you change copied, and same class is used in all the iterations.

So, got the problem.
Solution is, you should have this copied corresponding to each link. So make your link as object.

link = [{ link: 'url...', copied: false}, {}, ...].

and, check for each linkā€™s copied value.

Leave a comment