I have this code
Template :
<a href="#" class="video" @click.prevent="checkVideo(subItem.id)" :id="subItem.id" data-toggle="modal" data-target="#playerModal">{{subItem.name}}<span>{{getDuration(subItem.id)}}</span></a>
VueJS Function :
async getDuration(id) {
var duration = '';
await axios.post('/api/v1/checkvideo', {
menu: id
})
.then(function (response) {
console.log(response.data[0].datas.duration)
return response.data[0].datas.duration;
});
//console.log(duration);
//return duration;
},
The problem is that the console.log show the values as expected but on the Vue Rendering I get this [object Promise] I want to know how to show the values after the promise has been resolved.
Thanks for helping