diff --git a/components/Pagination.vue b/components/Pagination.vue index 664aad9..7262f8e 100644 --- a/components/Pagination.vue +++ b/components/Pagination.vue @@ -1,20 +1,24 @@ @@ -22,18 +26,17 @@ import MaterialIcon from './MaterialIcon.vue'; const props = defineProps<{ - hasPrevious: boolean; - hasFurtherPrevious: boolean; - hasNext: boolean; - hasFurtherNext: boolean; - pageIndex: number; - totalPages: number; + index: number, + pages: Array, + count: number, + onPrev: () => void, + onNext: () => void, + onFirst: () => void, + onLast: () => void, }>(); -const hasPreviousCss = !props.hasPrevious ? "disabled" : ""; -const hasFurtherPreviousCss = !props.hasFurtherPrevious ? "disabled" : ""; -const hasNextCss = !props.hasNext ? "disabled" : ""; -const hasFurtherNextCss = !props.hasFurtherNext ? "disabled" : ""; +const hasPrevCss = computed(() => { return !(props.index > 0) ? "disabled" : ""; }); +const hasNextCss = computed(() => { return !(props.index < props.count - 1) ? "disabled" : "";})