Skip to content

Commit

Permalink
feat: create pagination component
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed May 21, 2023
1 parent c8bca78 commit ecbc7a7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions components/pages/posts/navigation/PostsPagination.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script setup>
import { vIntersectionObserver } from '@vueuse/components'
const emit = defineEmits(['loadNextPage'])
function onIntersectionObserver([{ isIntersecting }]) {
if (!isIntersecting) {
return
}
emit('loadNextPage')
}
</script>

<template>
<div
v-intersection-observer="[onIntersectionObserver, { rootMargin: '650px' }]"
class="flex animate-pulse items-center justify-center rounded-md px-4 py-2 text-sm font-medium text-base-content ring-1 ring-base-0/20"
>
Loading next page&hellip;
</div>
</template>

0 comments on commit ecbc7a7

Please sign in to comment.