First change :model
to v-model=
, which is the syntax for Vue's built-in default model binding:
v-model="item.progress"
Now the item.progress
property will be automatically updated when the selection is changed. If you still need to do something more in the change
handler, you can pass both by passing the $event
variable (which will hold the selected value) along with the item:
@change="changeProgress($event, item)"
Your handler should then have a structure like:
methods: {
changeProgress(selected, item) {
console.log(selected, item);
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…