V
V
VegasChickiChicki2019-11-20 04:38:05
Vue.js
VegasChickiChicki, 2019-11-20 04:38:05

How to implement work with a large number of variables?

I am making a component, its essence is that it is a kind of filter in which there are a lot of options. Almost all options will be selected by the user by turning on / off, that is, pressing the button - the option is added to the filter, clicking on it again - the option is removed from the filter. There are about 10 sections, each with 5-10 such buttons. The difficulty is that I do not understand how to organize it correctly using Vue. I had the following idea:
1) We create an object and set the necessary fields in it
2) If the user has selected an option, we write this option in the required field, if we delete it, we delete it accordingly.
The task seems simple, I also thought so at first, but then I got stuck. Of course, you can put a bunch of fields with the type true\false in data, but I think you can make everything easier ('best practice'), but I can't figure out how...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Shvedov, 2019-11-20
@constintmid

1)Vuex
2)!status
play with this you yourself with at least 2 times the space

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question