How to realize real-time rendering of page time by using timer countdown in vue

the problem is this: when you use v-for to render a group of data, the backend will return a timestamp field to me. I need to time-stamp the page and start the countdown. Now the data can be printed on the console, but the page does not have Synchronize update rendering. Post the code and run the effect:

clipboard.png

clipboard.png

clipboard.png

clipboard.png

Mar.20,2021

instead of manipulating the original array, return a new array.

vue's diff is a shallow comparison, that is to say, for vue, you this.orderLists have not been updated, so vue will not re-render the page

. In

vue source code, only push (), pop (), shift (), unshift (), splice (), sort (), and reverse () of Array will trigger an attempt to update. Therefore, your above actions will not trigger an attempt to update, so you will not re-render the page


this.$nextTick try to see


can you guide us? what we give back at the backend is the start time. It expires for 5 minutes. The callback function cannot be returned in setInterval. Can you solve it?

Menu