Answer the question
In order to leave comments, you need to log in
What is the right way to implement this in vue?
I am writing a small component.
Slider, on each slide there is a block and a button that shows it.
The number of blocks is always different - sometimes 5, sometimes 10, sometimes 14.
I do the display of the block through a variable.
How to initialize them if I don't know exactly how many there will be, or is it just not done this way?
Answer the question
In order to leave comments, you need to log in
Or a complex array (in theory):
Slide1{block1{},block2{},...},Slide2{block1{},block2{},...},Slide3{block1{},block2{},.. },...
v-for iterate over blocks, but there will be a double v-for.
Or slide as a separate component (template may be the same for everyone, which is bad). For each Slide (Component) a separate array with a description of the blocks and dynamic loading of the components, those clicked on the "Button" of another template.
PS
the button that shows itI hope not bottom )))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question