D
D
danilr2019-06-18 12:40:48
JavaScript
danilr, 2019-06-18 12:40:48

How to make some list items hidden and expand on click?

It is necessary that some of the items are hidden (4 are constantly shown, the rest are expanded and collapsed by pressing the button). Like on a picture. Blocks and lists inside are output via v-for loop.
5d08b19149bf6850407761.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nvdfxx, 2019-06-18
@danilr

for each box, add the isOpen: false field, change it to !isOpen when clicked, bind a class to this thing

E
Eugene, 2019-06-18
@iamd503

Through css, hide the elements of the list, starting from 5. By clicking on the button, you can add a class to the list that will show all the elements

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question