[Vuejs]-How do I loop through an array in Vue half the amount of times as there are items?

2👍

You can just iterate through the array, place each element inside a b-col and specify the width of each of those columns to be 50%, like this:

<b-row>
    <b-col v-for="item in array" sm="6">
        ...do something with item
    </b-col>
</b-row>

sm="6" tells bootstrap to use the amount of space equal to 6 columns (i.e. 50%)
I am not sure about vue-bootstrap, but the bootstrap documentation states:

If more than 12 columns are placed within a single row, each group of
extra columns will, as one unit, wrap onto a new line

https://getbootstrap.com/docs/4.1/layout/grid/#column-wrapping

👤puelo

Leave a comment