data{
person:
[
{age:18,name:‘xiaoming’},
{age:22,name:‘xiaohua’}
]
}
function(){
let per = this.data.person[0]
this.setData({
[‘per.age’]: 15,
[‘per.value’]: ‘lantian’,
})
}
请问一下,我的这样写法有什么问题嘛,没有任何的效果,我尝试也用下面的写法也是没有效果
另外写法1:
function(){
let per = this.data.person[0]
this.setData({
[per.age]: 15,
[per.value]: ‘lantian’,
})
}
另外写法2:
function(){
let per = this.data.person[0]
this.setData({
per.age: 15,
per.value: ‘lantian’,
})
}
另外写法3:
function(){
let per = this.data.person[0]
this.setData({
‘per.age’: 15,
‘per.value’: ‘lantian’,
})
}