WeChat Mini Programs uses setdata to change the value of an attribute in an object array

/ / like
api.addLikeDiary (data). Then ((res) = > {

  if (res.code == 0) {
    let index = event.currentTarget.dataset.index  // 
    let isLike = this.data.diaryListInfo[`${index}`].isLike
    let likeCount = this.data.diaryListInfo[`${index}`].likeCount
    this.setData({
      [isLike]:!isLike
    })
    if (isLike) {
      this.setData({
        [likeCount]: likeCount -= 1
      })
    } else {
      this.setData({
        [likeCount]: likeCount += 1
      })
    }
  }
})

this.setData ({

)
  [isLike]:!isLike

}) cannot be reversed


this.setData({
      [isLike]:!isLike//isLike
    })

like this?

let isLike = "diaryListInfo[`${index}`].isLike"
let likeCount = "diaryListInfo[`${index}`].likeCount"

this.setData({
  [isLike]:!this.data.diaryListInfo[`${index}`].isLike
})

refer to WeChat Mini Programs: how to modify an array with setData?

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8056a-5b8e5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8056a-5b8e5.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?