diff --git a/docs/components/content/examples/PaginationExampleFirstLastSlots.vue b/docs/components/content/examples/PaginationExampleFirstLastSlots.vue new file mode 100644 index 0000000000..de65122d6e --- /dev/null +++ b/docs/components/content/examples/PaginationExampleFirstLastSlots.vue @@ -0,0 +1,20 @@ + + + diff --git a/docs/content/5.navigation/3.pagination.md b/docs/content/5.navigation/3.pagination.md index feaa98c31f..9a6840c56e 100644 --- a/docs/content/5.navigation/3.pagination.md +++ b/docs/content/5.navigation/3.pagination.md @@ -39,6 +39,8 @@ Use the `size` prop to change the size of the buttons. baseProps: modelValue: 1 total: 100 + showLast: true + showFirst: true props: size: 'sm' --- @@ -89,6 +91,33 @@ excludedProps: --- :: +### First / Last :u-badge{label="New" class="align-middle ml-2 !rounded-full" variant="subtle"} + +Use the `first-button` and `last-button` props to customize the first and last buttons of the Pagination. + +::component-card +--- +baseProps: + modelValue: 1 + total: 100 + showFirst: true + showLast: true +props: + firstButton: + icon: 'i-heroicons-arrow-small-left-20-solid' + label: First + color: 'gray' + lastButton: + icon: 'i-heroicons-arrow-small-right-20-solid' + trailing: true + label: Last + color: 'gray' +excludedProps: + - firstButton + - lastButton +--- +:: + ## Slots ### `prev` / `next` @@ -97,6 +126,12 @@ Use the `#prev` and `#next` slots to set the content of the previous and next bu :component-example{component="pagination-example-prev-next-slots"} +### `first` / `last` :u-badge{label="New" class="align-middle ml-2 !rounded-full" variant="subtle"} + +Use the `#first` and `#last` slots to set the content of the first and last buttons. + +:component-example{component="pagination-example-first-last-slots"} + ## Props :component-props diff --git a/src/runtime/components/navigation/Pagination.vue b/src/runtime/components/navigation/Pagination.vue index f0c72207ab..bd4950991d 100644 --- a/src/runtime/components/navigation/Pagination.vue +++ b/src/runtime/components/navigation/Pagination.vue @@ -1,10 +1,23 @@ @@ -94,6 +120,22 @@ export default defineComponent({ type: Object as PropType