Closed ethanclevenger91 closed 6 years ago
You can do something like this:
<i v-if="loading" class="fa fa-spin fa-spinner fa-3x"></i>
and fetchData method:
async fetchData({ page, filter, sort }) {
this.loading = true;
const response = await axios.get('/clients', {params: { page, filter, sort }});
this.loading = false;
return {
data: response.data.clients.data,
pagination: {
currentPage: response.data.clients.current_page,
totalPages: response.data.clients.last_page
}
};
}
Dear contributor,
because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.
I'd like to give this thing a spinner or something while it's loading. Is there some way to
v-if
for empty data and render something else in the meantime?