How does Vue ensure that paging is performed after asynchronously fetching all the data?

drop-down refresh, how to ensure that paging is performed after all data is obtained asynchronously?

// 
refresh() {
  // getOrderList
  this.getOrderList();

  // this.orderList.length, , 
  if (this.orderList.length > 0) {
    console.log("this.orderList", this.orderList);
    this.$toast("");
    this.isLoading = false;
  }
}
Apr.09,2022

you can use async and await. Synchronize


put the code of your if segment in the getOrderList method to get the data. It's best to encapsulate the method


getOrderList to return a Promise . Just put the code in then directly here.

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