I want to show the schedule, with if condition. If the index in the loop is the same as the index day, then display 'index' else is '-'.
for now, this is my view:
My code:
<td v-for="(n, i) in 7" :key="i">
<span :key="index" v-for="(item, index) in item.schedule_detail">
<span v-if="item.day === i">
<span>{{ item.day }}</span>
</span>
<span v-else>-</span>
</span>
</td>
My expectations:
Thanks a lot.
This
v-if
logic should work fine. See the below code