I am stuck with a nested for loop and a v-model inside it. I have no problems updating the data inside the first for-loop (row.amount), but when I change the input member.share for John in one row, all of John's shares are updated?
my component:
<div v-for="row in rows">
…
<input type="text" v-model="row.amount" />
<div v-for="member in row.teams">
<input type="text" v-model="member.share" />
</div>
</div>
This is the data:
rows: [
{
amount: 100,
team: [
{
name: John,
share: 0
},
{
name: Jane,
share: 0
}
]
},
{
amount: 299,
team: [
{
name: John,
share: 0
},
{
name: Jane,
share: 0
}
]
}
]