Refactor #6683 - For DataView

pull/6687/head
tugcekucukoglu 2024-10-30 15:07:24 +03:00
parent 0bc96d5ef3
commit 8b2ab6dbaf
2 changed files with 37 additions and 1 deletions

View File

@ -280,6 +280,10 @@ export interface DataViewSlots {
*/
layout?: string | undefined;
}): VNode[];
/**
* Custom paginator container template.
*/
paginatorcontainer(): VNode[];
/**
* Custom paginator start template.
*/

View File

@ -18,6 +18,22 @@
:unstyled="unstyled"
:pt="ptm('pcPaginator')"
>
<template v-if="$slots.paginatorcontainer" #container="slotProps">
<slot
name="paginatorcontainer"
:first="slotProps.first"
:last="slotProps.last"
:rows="slotProps.rows"
:page="slotProps.page"
:pageCount="slotProps.pageCount"
:totalRecords="slotProps.totalRecords"
:firstPageCallback="slotProps.firstPageCallback"
:lastPageCallback="slotProps.lastPageCallback"
:prevPageCallback="slotProps.prevPageCallback"
:nextPageCallback="slotProps.nextPageCallback"
:rowChangeCallback="slotProps.rowChangeCallback"
></slot>
</template>
<template v-if="$slots.paginatorstart" #start>
<slot name="paginatorstart"></slot>
</template>
@ -51,6 +67,22 @@
:unstyled="unstyled"
:pt="ptm('pcPaginator')"
>
<template v-if="$slots.paginatorcontainer" #container="slotProps">
<slot
name="paginatorcontainer"
:first="slotProps.first"
:last="slotProps.last"
:rows="slotProps.rows"
:page="slotProps.page"
:pageCount="slotProps.pageCount"
:totalRecords="slotProps.totalRecords"
:firstPageCallback="slotProps.firstPageCallback"
:lastPageCallback="slotProps.lastPageCallback"
:prevPageCallback="slotProps.prevPageCallback"
:nextPageCallback="slotProps.nextPageCallback"
:rowChangeCallback="slotProps.rowChangeCallback"
></slot>
</template>
<template v-if="$slots.paginatorstart" #start>
<slot name="paginatorstart"></slot>
</template>
@ -65,7 +97,7 @@
</template>
<script>
import { resolveFieldData, localeComparator, sort } from '@primeuix/utils/object';
import { localeComparator, resolveFieldData, sort } from '@primeuix/utils/object';
import Paginator from 'primevue/paginator';
import BaseDataView from './BaseDataView.vue';