话不多说直接上代码
for (let i = 0; i < _this.data.comment.length; i++) { if (e.currentTarget.dataset.id==_this.data.comment[i].id) { console.log(_this.data.comment[i].like_status) var param=_this.data.comment[i] _this.setData({ ['comment['+i+'].like_status']:true }) console.log(_this.data.comment[i].like_status) } }