My case like this :
If I search a data, it will show all data doctor. But for available day, I want to make it separately. when finished displaying all the doctor's data. I want to call the available method for async or call api to display available day. This available day is run when doctor data appears on the screen. So when the doctor's data appears on the screen, it will call available day. If the user scrolls down, it will call available day from another doctor
My code like this :
<v-col
v-for="(item, i) in items"
:key="i"
cols="12"
>
<v-card
dark
>
<div class="d-flex flex-no-wrap justify-space-between">
<div>
<v-card-title
class="headline"
v-text="item.doctor"
></v-card-title>
<v-card-subtitle v-text="item.hospital"></v-card-subtitle>
<v-card-subtitle>Available today</v-card-subtitle>
</div>
<v-avatar
class="ma-3"
size="125"
tile
>
<v-img :src="item.src"></v-img>
</v-avatar>
</div>
</v-card>
</v-col>
Demo and full code like this : https://codepen.io/trendingnews/pen/ZEYpBeW?editors=1010
My problem is
If I display all the doctor's data, for example 50 data, it's very fast. only 2-3 seconds
But if I display all the doctor's data and available days, for example 50 data, it's very slow. around 10 seconds
So for available day, I want to make it separate. It's only called when the doctor's data appears on the screen
Doctor data and available day are different API. So this is my problem. I have to handle this from the front end
How can I do that? Is there a package that can help? I have used vuex store in this project
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…