Vue in uniapp forces refresh of partial view data

When developing uniapp, we often encounter situations where we want to modify some data in the current data. The console output is correct, but the interface still displays the old data.

try

 

  • this.$set(obj, key, value);---this.$set(original object, which item in the data, assignment);
    // 倒计时状态。
    waitStatusFun(status, secondsChange, index) {
      this.$set(this.videoFaceRecordList[index], 'status', status);
    },
  • Object.assign(target, sources)
   // 倒计时状态。
    waitStatusFun(status, secondsChange, index) {
            this.videoFaceRecordList[index] = Object.assign({}, this.videoFaceRecordList[index])
    },

Both should be solvable.

If it happens to solve your problem, you can give me a little heart~

Guess you like

Origin blog.csdn.net/weixin_38791717/article/details/109998273