I am in the process of transitioning my code to Vue.js, so I am relatively new to Vue. In the screenshot provided (linked below), you can see that there are 4 columns inside a div with the class name columns
. I attempted to use the index, like v-if='index % 4 === 0'
, but I was unable to access the index outside of the v-for
loop.
This is what I am trying to achieve: https://i.stack.imgur.com/aO2Rx.png
<template lang="pug">
.container
.columns // add this after every 4 coulmns
.column.is-3.vid(v-for='(item,index) in items')
.panel
p.is-marginless
a(:href='item.videoId')
img(:src='item.thumbnail')
.panel.vidInfo
.columns.hax-text-centered
.column
.panel-item.reddit-ups
span {{ item.score }}
i.fa.fa-reddit-alien.fa-2x
.panel-item.reddit-date
i.fa.fa-calendar.fa-2x
</template>