I want make a increment variable inside v-for
This is my code in vuejs:
<tr v-for="(item,index) in vtype_all" :key="index" :set="incrementI = 0">
<template v-for="item2 in data_tanggal1">
<td :key="item2.id" v-if="item2 == item.baseTanggal[incrementI].tanggal">{{item.baseTanggal[incrementI].hitc+'spasi'+incrementI}}</td>
<td :key="item2.id" v-if="item2 == item.baseTanggal[incrementI].tanggal">{{item.baseTanggal[incrementI].hith}}</td>
<td :key="item2.id" v-if="item2 != item.baseTanggal[incrementI].tanggal">0</td>
<td :key="item2.id" v-if="item2 != item.baseTanggal[incrementI].tanggal">0</td>
<template v-if="item2 == item.baseTanggal[incrementI].tanggal" :set="incrementI = incrementI+1"></template>
</template>
<td>{{ item.jumQty }}</td>
<td>{{ item.jumHrg }}</td>
</tr>
This is what I want (laravel blade):
@foreach($dataProduct['byVtype'] as $row)
<?php $i=0; ?> <!--can insert variable -->
<tr>
<td>{{$row['detail'][0]['vgrp_product']}}</td>
<td>{{$row['detail'][0]['ptype']}}</td>
<td>{{$row['detail'][0]['vgrp_nominal']}}</td>
<?php for($j=0;$j<count($dataProduct['byTanggal']);$j++) { ?>
<?php if(isset($row['baseTanggal'][$i]['tanggal']) ){ ?>
@if($dataProduct['byTanggal'][$j] == $row['baseTanggal'][$i]['tanggal'])
<td>{{$row['baseTanggal'][$i]['hitc']}}</td>
<td>{{$row['baseTanggal'][$i]['hith']}}</td>
<?php $i++; ?> <!-- increment varible if condition true -->
@else
<td>0</td>
<td>0</td>
@endif
<?php } ?>
<?php } ?>
<td>{{ $row['jumQty'] }}</td>
<td>{{ $row['jumHrg'] }}</td>
</tr>
@endforeach
I already set increment $i but it still returns value 0, not the incremented value.