this.setData({
"bottomTip[this.data.nav.currentIndex].state": 2
})
this.data.nav.currentIndex 是不确定的
有办法这样赋值吗?
this.setData({
"bottomTip[this.data.nav.currentIndex].state": 2
})
this.data.nav.currentIndex 是不确定的
有办法这样赋值吗?
var state= "bottomTip["+this.data.nav.currentIndex+"].state";
this.setData({
[state]: 2
})
你这样的赋值逻辑有点奇怪,应该是这样吧
data: {
bottomTip:[]
}
changeData: function(){
bottomTip[this.data.nav.currentIndex].state = 2
this.setData({
bottomTip: bottomTip
})
}