V
V
Victor Poltoratsky2020-09-19 17:04:17
Vue.js
Victor Poltoratsky, 2020-09-19 17:04:17

What is the correct way to work with identical vue.js elements?

Good day, there is such a task https://codepen.io/melrose13-69/pen/qBZJYQz
Recently I started getting acquainted with vue, this time I'm stuck on this example, the fact is that when you click on the button in the item, it assigns the item class, for this class I want to make display none, but by clicking on the button the class changes on all similar items, help me fix it

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
bqio, 2020-09-19
@bqio

So you loop through all of them and assign this class. On click, call the method, in which you already check on which element the event fired and already change styles on it. Well, if it’s quite simple, then when specifying a condition in :class, check by index.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question