From bd9686dbd8159e482943a73ce569aad9da34ead9 Mon Sep 17 00:00:00 2001 From: roymondchen Date: Mon, 23 Oct 2023 11:14:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(form):=20table=E5=88=86=E9=A1=B5lastData?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/form/src/containers/Table.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/form/src/containers/Table.vue b/packages/form/src/containers/Table.vue index 4c4274d7..c58f4c9d 100644 --- a/packages/form/src/containers/Table.vue +++ b/packages/form/src/containers/Table.vue @@ -249,7 +249,7 @@ const modelName = computed(() => props.name || props.config.name || ''); const data = computed(() => props.config.pagination - ? props.model[modelName.value].filter( + ? (props.model[modelName.value] || []).filter( (item: any, index: number) => index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value, ) @@ -258,11 +258,11 @@ const data = computed(() => const lastData = computed(() => props.config.pagination - ? props.lastValues[modelName.value].filter( + ? (props.lastValues[modelName.value] || []).filter( (item: any, index: number) => index >= pagecontext.value * pagesize.value && index + 1 <= (pagecontext.value + 1) * pagesize.value, ) - : props.lastValues[modelName.value] || {}, + : props.lastValues[modelName.value] || [], ); const sortChange = ({ prop, order }: SortProp) => {