数组 this.setData快捷赋值

let list=this.data.list;
let listString = `{"list[${index}].sliderSure":"${!list[index].sliderSure}"}`;
listString = JSON.parse(listString);
this.setData(listString);

let chestr = `{"specials.${e.currentTarget.dataset.chekey}.enable":${e.detail.value}}`;
console.log(chestr)
this.setData(JSON.parse(chestr))

 

posted @ 2018-10-12 14:49  ThisCall  阅读(1120)  评论(0编辑  收藏  举报