From 6580c65be3c4e7cd5db582620846e078fab5335b Mon Sep 17 00:00:00 2001 From: victor Date: Fri, 23 Dec 2022 17:25:45 +0400 Subject: [PATCH] doc: updated doc --- docs/.vitepress/config.ts | 2 +- docs/components/pagination.md | 64 ++++++++++++++++--- .../pagination/examples/PaginationExample.vue | 2 +- .../examples/PaginationTableExample.vue | 2 +- .../examples/PaginationWithCustomSlice.vue | 11 ++++ src/components/Pagination/Pagination.vue | 2 +- 6 files changed, 71 insertions(+), 12 deletions(-) create mode 100644 docs/components/pagination/examples/PaginationWithCustomSlice.vue diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index fe1830a..649fdf6 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -44,6 +44,7 @@ function getComponents() { { text: 'Card', link: 'components/card.md' }, { text: 'Carousel', link: 'components/carousel' }, { text: 'Dropdown', link: '/components/dropdown' }, + { text: 'Pagination', link: 'components/pagination' }, { text: 'Progress', link: 'components/progress' }, { text: 'Rating', link: 'components/rating' }, { text: 'Spinner', link: '/components/spinner' }, @@ -57,7 +58,6 @@ function getComponents() { { text: 'Navbar', link: 'components/navbar' }, { text: '- Footer', link: 'components/footer' }, - { text: '- Pagination', link: 'components/pagination' }, { text: '- Sidebar', link: 'components/sidebar' }, ] } diff --git a/docs/components/pagination.md b/docs/components/pagination.md index cdeea44..f752709 100644 --- a/docs/components/pagination.md +++ b/docs/components/pagination.md @@ -4,6 +4,7 @@ import PaginationNavigationExample from './pagination/examples/PaginationNavigat import PaginationTableExample from './pagination/examples/PaginationTableExample.vue'; import PaginationWithIconsExample from './pagination/examples/PaginationWithIconsExample.vue'; import PaginationWithCustomTextExample from './pagination/examples/PaginationWithCustomTextExample.vue'; +import PaginationWithCustomSlice from './pagination/examples/PaginationWithCustomSlice.vue'; # Vue Pagination Component - Flowbite @@ -12,60 +13,107 @@ import PaginationWithCustomTextExample from './pagination/examples/PaginationWit ```vue +``` + + +## Default with custom length +You can use your own pages count in the row by passing props: `slice-length` +This prop means left side and right side pages row slicing. In the example it has value `4`. So row length will be 4 + 1 + 4 pages - 9 pages. + +```vue + + ``` - + ## Pagination with navigation layout ```vue ``` ## Pagination with table layout +To use that layout you have to pass required props: +- `per-page`: it's items count displayed on each page. +- `total-items`: it's the total items count. + +And there you don't need to use `total-pages` prop. ```vue ``` - + ## Pagination with icons ```vue ``` - + ## Pagination with custom labels ```vue ``` + diff --git a/docs/components/pagination/examples/PaginationExample.vue b/docs/components/pagination/examples/PaginationExample.vue index 845de13..b1322db 100644 --- a/docs/components/pagination/examples/PaginationExample.vue +++ b/docs/components/pagination/examples/PaginationExample.vue @@ -1,5 +1,5 @@ diff --git a/docs/components/pagination/examples/PaginationTableExample.vue b/docs/components/pagination/examples/PaginationTableExample.vue index 5660d0b..8a3105a 100644 --- a/docs/components/pagination/examples/PaginationTableExample.vue +++ b/docs/components/pagination/examples/PaginationTableExample.vue @@ -2,8 +2,8 @@
diff --git a/docs/components/pagination/examples/PaginationWithCustomSlice.vue b/docs/components/pagination/examples/PaginationWithCustomSlice.vue new file mode 100644 index 0000000..ce14e87 --- /dev/null +++ b/docs/components/pagination/examples/PaginationWithCustomSlice.vue @@ -0,0 +1,11 @@ + + diff --git a/src/components/Pagination/Pagination.vue b/src/components/Pagination/Pagination.vue index 6c1158a..3c25526 100644 --- a/src/components/Pagination/Pagination.vue +++ b/src/components/Pagination/Pagination.vue @@ -79,7 +79,7 @@ const props = defineProps({ }, sliceLength: { type: Number, - default: 3, + default: 2, }, previousLabel: { type: String,