From e5b588ad45a719046fe15591b7461ef88ed07703 Mon Sep 17 00:00:00 2001 From: zlm <1543057945@qq.com> Date: Tue, 6 Sep 2022 17:13:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=88=86=E9=A1=B5=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=BC=98=E5=85=88=E5=8F=96data=E9=87=8C=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E5=8F=AF=E4=BF=9D=E8=AF=81=E6=9C=8D=E5=8A=A1=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=E5=A4=B1=E8=B4=A5=E5=90=8E=EF=BC=8C=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E4=B8=8D=E5=8F=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/usePagination.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/usePagination.ts b/src/usePagination.ts index 91378cd..6c8cee9 100644 --- a/src/usePagination.ts +++ b/src/usePagination.ts @@ -151,7 +151,7 @@ function usePagination( const total = computed(() => get(data.value!, totalKey, 0)); const current = computed({ get: () => - (params.value[0] as Record)?.[currentKey] ?? + data.value?.[currentKey]??(params.value[0] as Record)?.[currentKey] ?? finallyOptions.defaultParams[0][currentKey], set: (val: number) => { changeCurrent(val); @@ -159,7 +159,7 @@ function usePagination( }); const pageSize = computed({ get: () => - (params.value[0] as Record)?.[pageSizeKey] ?? + data.value?.[pageSize]??(params.value[0] as Record)?.[pageSizeKey] ?? finallyOptions.defaultParams[0][pageSizeKey], set: (val: number) => { changePageSize(val); -- Gitee