I am new in stack overflow.
I am using Vue3 + tailwindcss.
I want to create dyamic grid like this

Corrrection: Here i want repetitive layout and the item of loop are dynamic
Here is My code:
<template>
<div class="min-h-screen flex items-center bg-purple-500">
<div class="flex-1 max-w-4xl mx-auto p-8">
<ul class="grid grid-cols-12 gap-8">
<template v-for="(i,index) in 8" :key="index">
<li
class="col-span-12 sm:col-span-6 md:col-span-4 bg-white rounded-lg shadow-xl"
v-if="updateCounter(index) || (index+1) % 8 != 0"
>
<div class="h-24"> {{ index }} {{updateCounter(index) }}</div>
</li>
<li
v-else
class="col-span-12 sm:col-span-6 md:col-span-6 bg-white rounded-lg shadow-xl"
>
<div class="h-24">{{ index }} </div>
</li>
</template>
</ul>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const count = ref<number>(2)
const checkForCols = ref<boolean>(false);
const total = ref<number>(6)
const updateCounter = (index: any) => {
if( total.value == index ){ // 0 = (0 1) , 1 = (1 1)+1, 2 = (2 1)+1, 3 = (3 1)+1,4 = (4 1) + 1, 5 = (5 1)+1
total.value = total.value + 6 + count.value
return true
} else {
return false
}
}
</script>
But i get Wrong output.

I already spend 2 day but i can't find any solution.
So can anyone help me to how i do this?
Thank you in advance.