3 回复
自己在小程序中单独实现了同比绑定功能
<input style=‘color:#f00736;’ type=‘number’ placeholder=‘請輸入金額’ id=’{{index}}’ value=’{{item.value}}’ placeholder-class=‘com-phd-color’ bindchange=‘synchroValue’ bindfocus=‘synchroFilter’></input>
data: {
dataList: [
{
name: null,
value: null
}
]
},
synchroValue: function(e) {
let val = e.detail.value;
let id = e.target.id;
let data = this.data.dataList;
data[parseInt(id)].value = val;
this.setData({
dataList: data
});
}