微信小程序数组里的值修改,for循环修改数组内容

话不多说直接上代码

        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)
          }
        }
原文地址:https://www.cnblogs.com/guomouren/p/13225259.html