If you want to filter elements in an array based on a specific condition, you can achieve this by using a computed property. Create an array within the computed property that only includes elements with indexes divisible by 3. Then, utilize this filtered array in your v-for loop. Below is an example of how you can implement this in your Vue.js component:
<div>
<li v-for="(item, index) in elementInThirdPlace" :key="index">
{{ item }}
</li></div>
export default {
data () {
return { items: [1,2,3,4,5,6,6] }
},
computed: {
elementInThirdPlace () {
return this.items.filter((element, index) => index % 3 == 0 )
}
}
}
}