[Vuejs]-VueJS – Display Countdown of setInterval function

1πŸ‘

βœ…

in pullData function create new interval and add leftTime = 900000 field which will updating every second :

async pullData() {
   setInterval(() => {
     this.leftTime = -= 1000;
     console.log(leftTime)
   }, 1000);
   this.loading = true;
   const getData = await axios.get(`/api/v1/card/${this.card}`);
   this.data = await getData.data.data;
   this.loading = false;
}

Leave a comment