I'm using vue-cli and I'm trying to figure out how to update counter in my template:
<div v-for="(item, index) in outerArray" :key="item.id" v-bind:id="item.name">
<div> <p> {{ item.name }}</p> </div>
<div>Count:{{count}}</div>
I would like the counter to update for each user based off of how many alerts are in warning array:
outerArray:[
{ name: 'Ray',
count: null,
warning: [{time: '2:00', alert: 'G: 150',},
{time: '7:00', alert: 'RR: 38',}]
},
{ name: 'Mike',
count: null,
warning:[{time: '9:00',alert: 'G: 40',}]
},
]
So the output should look like:
Ray Mike
Count:2 Count:1
Any help would be appreciated, thanks!
Update
I used:
this.outerArray[index].warning.length
to display how many alerts were in warnings.