R
R
RomanKudlatov2021-06-23 23:59:53
Vue.js
RomanKudlatov, 2021-06-23 23:59:53

How to group in v-for?

There is a large list of product characteristics, is it possible to somehow transfer them in portions via v-for?
The task is to make a slider in which there will be 3 characteristics on each slide.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2021-06-24
@RomanKudlatov

Make a method that takes 2 arguments - start and end.
Return the result of the characteristics.slice(start, end) method.
Or make a computed property from which to return an array of characteristics divided into chunks of 3 elements.
And to work with this in v-for, generating slides. I would choose the second option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question