//例如现在有个数组
data:{
list:[
{
index:0
},
{
index:1
},
]
}
//改变data里值的事件
change:function(){
var id= "list[" + 0 + "].index"
this.setData({
[id]:2 //相当于list[0].index = 2
})
}
希望本文章能解决您的问题~
//例如现在有个数组
data:{
list:[
{
index:0
},
{
index:1
},
]
}
//改变data里值的事件
change:function(){
var id= "list[" + 0 + "].index"
this.setData({
[id]:2 //相当于list[0].index = 2
})
}
希望本文章能解决您的问题~