V
V
vetsmen2019-08-22 16:48:44
Vue.js
vetsmen, 2019-08-22 16:48:44

How to bind event and styles?

What you need: when you click on an element from the list, change its styles. When you click again, return the styles to their original state.
As I do now: I assign the selected: false property to each element when received from the server, and then I already bind styles and hang event handlers on selected
Is it normal practice to do this or are there easier options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sashqa, 2019-08-22
@Sashqa

Isn't that easier?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question