566627239b
- Create new PaginationView component to standardize pagination display - Update multiple list components to use the new PaginationView - Make paginationMeta prop required in list components
25 lines
550 B
Vue
25 lines
550 B
Vue
<script setup lang="ts">
|
|
import type { PaginationMeta } from '~/components/pub/custom-ui/pagination/pagination.type'
|
|
import Pagination from './pagination.vue'
|
|
|
|
const props = defineProps<{
|
|
paginationMeta: PaginationMeta
|
|
}>()
|
|
|
|
const emit = defineEmits<{
|
|
pageChange: [page: number]
|
|
}>()
|
|
|
|
function handlePageChange(page: number) {
|
|
emit('pageChange', page)
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<Pagination
|
|
v-if="props.paginationMeta && props.paginationMeta.pageSize > 0"
|
|
:pagination-meta="paginationMeta"
|
|
@page-change="handlePageChange"
|
|
/>
|
|
</template>
|