v-for出来的InputNumber 等等等的东西,change里的 @change="test" 是无法传index和value的,通过传index来获取value值
@change="userquantity(index)"
这是我项目中用的
userquantity(index){ this.updateInSuranceData[index].quantity = this.ontentInsurance[index].quantity console.log(this.updateInSuranceData) },
意思就是
在test方法中
@change="test(index)" 传入index
data() {
return {
num1: 1,
list:[{num:1},{num:1},{num:1},{num:1}]
}
},
test(index){
console.log(index)
console.log(this.list[index].num)
}