Alternating between two divs with v-for?
I have an array of "tile data" and I am trying to achieve the following pattern:
I don't want to have wrappers around one tile and split for example, since the point is to have the splits right next to two tiles. Is this achievable with v-for?
3 Replies
have you two arrays for "tile data" and "split data" or one array with all data?
This is not really nuxt specific. It's basic vue.
Im not sure if i got you right, but:
Will results in
Use index and modulo to achieve this
https://www.freecodecamp.org/news/javascript-modulo-operator-how-to-use-the-modulus-in-js/
freeCodeCamp.org
JavaScript Modulo Operator – How to Use the Modulus in JS
In JavaScript, you may need to perform mathematical calculations such as determining if a number is even or odd, wrapping values within a range, and converting between degrees and radians in trigonometry. To help you perform all these mathematical calculations, the modulo operator can be extremely useful. This article will