vue-async-function
vue-async-function copied to clipboard
async method in v-for?
can i call async method in v-for?
Yes. But keep in mind that each component you render in v-for will trigger a separate network call. Also, if the list is often updated, this is again trigger individual network calls.
excellent... can you please give me an example?
<div v-for="item in taskList" >
<div v-for="(eachRow,index6) in mapGrid(item,_.clone(eachGrid))">
<input type="text" v-model="eachRow.text" />
</div>
</div>
.
.
export default {
methods: {
async mapGrid(taskItem,eachGrid){
let response=await axios.get().... ;
return response;
}
}
}