As a newcomer to Vue.js, I'm struggling with certain concepts even after extensively reading the documentation!
My goal is to show a glyphicon when my API call returns true.
However, since the call is within a for loop iterating over multiple items, I'm unable to store the response in a variable due to it getting overwritten with each iteration...
The specific code where I want to implement this display is as follows:
<div class="list-group-item"
v-for="item in exercices['data']" :key="item">
<h3 class="list-group-item-heading titre">
<p><a > {{ item[1] }}</a>
<span v-if="checkIsValid(item[0]) === true">
<span class="glyphicon glyphicon-ok" ></span>
</span>
</p>
And the axios call is made in this part of the code:
checkIsValid(id, index){
this.$axios
.get('http://127.0.0.1:5000/checkIsValid/'+id+'/'+ Vue.prototype.$userMail)
.then(response => ( ??? )
)
}
Any suggestions or ideas on how to approach this challenge would be greatly appreciated!
Thank you in advance!