The voting page does not refresh the number of votes++

1. Click the vote button

 vote(id) {
      Toast.loading({
        duration: 0, // 持续展示 toast
        forbidClick: true,
        message: '加载中...',
      })
      logaddlog({ cartoonId: id }).then((res) => {
      if (res.code == 200) {
          const idx = this.list.findIndex((t) => t.id == id)
          const voteNum = this.list[idx].voteNum
          this.$set(this.list, idx, { ...this.list[idx], voteNum: voteNum + 1 })
          Toast.clear()
          this.$toast(res.msg)
        } else {
          Toast.clear()
          this.$toast(res.msg)
        }
      })
    },

Guess you like

Origin blog.csdn.net/weixin_57905352/article/details/125272123