The method of nesting methods in v-for, resulting in an endless loop

<div class="history">
  <ul>
  <template v-for="(item,index) in historyList.elementList" >
   <li :id="("lishi_"+index)" :key="index" :class="{"historyHover":pos==2&&itemNo==(index)}" >
      <img :src="item.assetImg?item.assetImg:item.elementImg" />
      <div class="h_progress" v-show="!(pos==2&&itemNo==(index))">
        <p v-show="item.assetType!= undefined && item.assetType!="Movie"">{{parseInt(item.episode)}}

<p v-if="item.recordTime!= undefined && item.recordTime!= "0"">{{getWatchTime(item.recordTime,index)}}

</div> <span class="history-title" v-show="(pos==2&&itemNo==(index))">{{item.assetName?item.assetName:item.elementName}}</span> </li> </template> </ul> </div> created () { this.jsonData = this.initData; if (this.jsonData.elementList[0].elementList){ this.eleId = this.jsonData.specialId; this.swipeList = this.jsonData.elementList[0].elementList; this.bgPhoto = this.swipeList[0].elementImg; this.rec = this.jsonData.elementList; this.historyList = this.jsonData.elementList[3]; this.timeTask(); } try { let historyData = JSON.parse(localStorage.getItem("historyList")); console.log(historyData); console.log("" + JSON.stringify(historyData)); if (historyData.length == 0) return; if (historyData.length >= 2){ historyData = historyData.slice(0, 2) }; this.historyList.elementList = historyData; } catch (error) { }

},
activated () {

try { // 
  let historyData = JSON.parse(localStorage.getItem("historyList"));
  console.log("" + JSON.stringify(historyData));
  if (historyData.length == 0) return;
  if (historyData.length >= 2){ historyData = historyData.slice(0, 2) };
  this.historyList.elementList = historyData;
} catch (error) {
  console.log("");
}

},
methods: {

getWatchTime (ms, index){
  console.log(":" + index);
  console.log(":" + ms);
  // return new Date(parseInt(ms)).format("mm:ss");
},


clipboard.png

does anyone know!

Jul.19,2022

buddy, there's something wrong with the writing

{{getWatchTime(item.recordTime,index)}}

it is written that the method is called directly during rendering, and you should trigger this method at some point, such as a click event or other

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-1b40880-348e8.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-1b40880-348e8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?