From 96e0ce98663eb69e854d1c1d2895a5ac34701521 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Fri, 17 Mar 2023 22:32:25 +0800 Subject: [PATCH] =?UTF-8?q?Table=20=E7=BB=84=E4=BB=B6=EF=BC=9A1=EF=BC=89?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20tableMethods=20=E5=B1=9E=E6=80=A7=EF=BC=8C?= =?UTF-8?q?=E6=8F=90=E5=8D=87=E4=BB=A3=E7=A0=81=E7=9A=84=E5=8F=AF=E9=98=85?= =?UTF-8?q?=E8=AF=BB=E6=80=A7=EF=BC=9B2=EF=BC=89Table=20=E5=92=8C=20Pagina?= =?UTF-8?q?tion=20=E7=BB=84=E4=BB=B6=E7=9A=84=E9=80=BB=E8=BE=91=E7=BB=9F?= =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Pagination/index.vue | 2 +- src/components/Table/src/Table.vue | 6 ++++-- src/hooks/web/useTable.ts | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue index 9fc35068..788809a5 100644 --- a/src/components/Pagination/index.vue +++ b/src/components/Pagination/index.vue @@ -5,7 +5,7 @@ class="float-right mt-15px mb-15px" :background="true" layout="total, sizes, prev, pager, next, jumper" - :page-sizes="[10, 20, 30, 50]" + :page-sizes="[10, 20, 30, 50, 100]" v-model:current-page="currentPage" v-model:page-size="pageSize" :pager-count="pagerCount" diff --git a/src/components/Table/src/Table.vue b/src/components/Table/src/Table.vue index 66969c99..8ca59684 100644 --- a/src/components/Table/src/Table.vue +++ b/src/components/Table/src/Table.vue @@ -104,11 +104,12 @@ export default defineComponent({ }) const pagination = computed(() => { + // update by 芋艿:保持和 Pagination 组件的逻辑一致 return Object.assign( { small: false, background: true, - pagerCount: 5, + pagerCount: document.body.clientWidth < 992 ? 5 : 7, layout: 'total, sizes, prev, pager, next, jumper', pageSizes: [10, 20, 30, 50, 100], disabled: false, @@ -283,10 +284,11 @@ export default defineComponent({ }} {unref(getProps).pagination ? ( + // update by 芋艿:保持和 Pagination 组件一致 ) : undefined} diff --git a/src/hooks/web/useTable.ts b/src/hooks/web/useTable.ts index 7a9b1afe..3f0d5055 100644 --- a/src/hooks/web/useTable.ts +++ b/src/hooks/web/useTable.ts @@ -218,6 +218,8 @@ export const useTable = (config?: UseTableConfig) => { register, elTableRef, tableObject, - methods + methods, + // add by 芋艿:返回 tableMethods 属性,和 tableObject 更统一 + tableMethods: methods } }