From a8a2298a6dbc6710759b6cb4dc32939ac2e89b87 Mon Sep 17 00:00:00 2001 From: yang <30883395+webvs2@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:29:51 +0800 Subject: [PATCH] feat(pagination) : add `size` prop (#16858) * fix(components): [table] closed #11023 * fix(components): add component prop 'size' and related style supplement BREAKING CHANGE : size closed #16830 * Update component documentation * Update documentation and tests * Optimized using useFormSize * Keep the 'small' api for now * Eliminate unwanted code * Eliminate the impact of errors * Remove 'ref' * Update docs/examples/pagination/more-elements.vue Co-authored-by: qiang * Modify documents and declarations * Eliminate uselessness * Update packages/components/pagination/src/pagination.ts Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com> * Update docs/en-US/component/pagination.md Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com> * Update packages/components/pagination/src/pagination.ts Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com> * Adjust public access * pass Lint * Modify attribute acquisition * change the source of 'size' * remove `pagination-font-size-large` * Lift response * Update packages/theme-chalk/src/common/var.scss Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com> * Update pagination.ts * Update docs/examples/pagination/more-elements.vue --------- Co-authored-by: yang <29636098325@qq.com> Co-authored-by: qiang Co-authored-by: kooriookami <38392315+kooriookami@users.noreply.github.com> Co-authored-by: btea <2356281422@qq.com> --- docs/en-US/component/pagination.md | 5 +-- docs/examples/pagination/more-elements.vue | 20 ++++++------ docs/examples/pagination/small-pagination.vue | 4 +-- .../pagination/__tests__/pagination.test.tsx | 2 +- .../components/pagination/src/pagination.ts | 32 ++++++++++++++----- packages/theme-chalk/src/common/var.scss | 2 ++ packages/theme-chalk/src/pagination.scss | 13 ++++++++ 7 files changed, 56 insertions(+), 22 deletions(-) diff --git a/docs/en-US/component/pagination.md b/docs/en-US/component/pagination.md index e2f092b1f5..8964ff908c 100644 --- a/docs/en-US/component/pagination.md +++ b/docs/en-US/component/pagination.md @@ -35,7 +35,7 @@ pagination/background-color Use small pagination in the case of limited space. -:::demo Just set the `small` attribute to `true` and the Pagination becomes smaller. +:::demo set size to change the `size`. Here is a demonstration of `small` pagination/small-pagination @@ -67,7 +67,8 @@ pagination/more-elements | Name | Description | Type | Default | | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------ | -| small | whether to use small pagination | ^[boolean] | false | +| small ^(deprecated) | whether to use small pagination | ^[boolean] | false | +| size ^(2.7.6) | pagination size | ^[enum]`'large'\| 'default'\| 'small'` | 'default' | | background | whether the buttons have a background color | ^[boolean] | false | | page-size / v-model:page-size | item count of each page | ^[number] | — | | default-page-size | default initial value of page size, not setting is the same as setting 10 | ^[number] | — | diff --git a/docs/examples/pagination/more-elements.vue b/docs/examples/pagination/more-elements.vue index ffcc97b00f..e4a8638fd5 100644 --- a/docs/examples/pagination/more-elements.vue +++ b/docs/examples/pagination/more-elements.vue @@ -1,8 +1,10 @@