Update SourceView.vue
This commit is contained in:
@@ -74,11 +74,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex justify-center">
|
||||
|
||||
<div class="flex justify-center">
|
||||
<div v-show="loading">
|
||||
<lottie-player src="https://assets9.lottiefiles.com/private_files/lf30_bIUWq7.json" background="transparent" speed="3" style="width: 100px; height: 100px;" loop autoplay></lottie-player>
|
||||
<lottie-player
|
||||
src="https://assets9.lottiefiles.com/private_files/lf30_bIUWq7.json"
|
||||
background="transparent"
|
||||
speed="3"
|
||||
style="width: 100px; height: 100px;"
|
||||
loop
|
||||
autoplay
|
||||
></lottie-player>
|
||||
</div>
|
||||
|
||||
<button
|
||||
@@ -140,17 +146,19 @@ export default {
|
||||
methods: {
|
||||
fetchNewArticles() {
|
||||
this.loading = true;
|
||||
axios
|
||||
.get(
|
||||
`/api/source/${this.source.slug}?page=${this.current_page +
|
||||
1}`
|
||||
)
|
||||
.then(response => {
|
||||
this.current_page = response.data.articles.current_page;
|
||||
// spread the array item into individual arguments
|
||||
this.articles.push(...response.data.articles.data);
|
||||
this.loading = false;
|
||||
});
|
||||
sleep(2000).then(() => {
|
||||
axios
|
||||
.get(
|
||||
`/api/source/${this.source.slug}?page=${this
|
||||
.current_page + 1}`
|
||||
)
|
||||
.then(response => {
|
||||
this.current_page = response.data.articles.current_page;
|
||||
// spread the array item into individual arguments
|
||||
this.articles.push(...response.data.articles.data);
|
||||
this.loading = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user