改变input里的值数组里的值也跟着变
代码部分:
data: {
true_s:false,
tats:'',
ssock: [{
numbe: 36,
name: '售货机1',
picUrl: '../../images/ssock.png',
picname: '阔阔阔乐',
ssock: 15
}, {
numbe: 35,
name: '售货机2',
picUrl: '../../images/ssock.png',
picname: '阔阔阔乐',
ssock: 19
}, {
numbe: 34,
name: '售货机15',
picUrl: '../../images/ssock.png',
picname: '阔阔阔乐',
ssock: 14
}, {
numbe: 31,
name: '售货机3',
picUrl: '../../images/ssock.png',
picname: '阔阔阔乐',
ssock: 10
}]
},
binbtn_ok:function(e){
var that = this;
var index = e.currentTarget.dataset.index;
var ta = that.data.ssock;
var tats = that.data.tats
that.setData({
true_s: false,
})
},
要的是这个效果吗,可以改变数组对象某个属性的值?是的话示例代码如下。
社区类似问https://segmentfault.com/q/10...