How does vue listen for a change in an array of data and highlight it?

<template>
  <div>
    <ul>
      <li v-for="data in datas" :key="data.id">{{data}}</li>
    </ul>
  </div>
</template>

export default {
  data() {
    return {
      datas: []
    };
  }
};

this datas returns new data every 5 seconds through setInterval, and some of the data in it may change. How to make some changed data (a li) flash to prompt the user?

Mar.28,2021

according to the description of the landlord
We only need to listen for changes in stock values
here value is used instead of
you can save the data obtained last time

{
    oldDatas:[]
}

then the new list compares the value of the value with the old list, which can be highlighted by adding the class name to the li

<li v-for="(data,index) in datas" :key="data.id" :class="{isChanged: oldDatas[index].value !=== data.value}">{{data}}</li>
Menu