I have several components in my table with different times to count to. The problem is i need to send request to server every second, so the time as I refresh will change to correct time. (deadlines functionality)
Here is my code:
<div class="table-row" :key="task.id" v-for="(task, id) in tasks">
<div class="task-deadlines">
<countdown :time="task.seconds" @progress="handleCountdownProgress" :auto-start='true'>
<template slot-scope="props">{{ props.days }} д. {{ props.hours }} ч. {{ props.minutes }} м. {{ props.seconds }} с.</template>
</countdown>
</div>
</div>
Method:
handleCountdownProgress(data){
let time = data.totalMilliseconds;
// cant get an id here...
this.$store.dispatch('UPDATE_TIME', { id: id, seconds: time });
}
I have several components in my table with different times to count to. The problem is i need to send request to server every second, so the time as I refresh will change to correct time. (deadlines functionality)
Here is my code:
Method:
Is there any way to do this?