From ea50d63c43c7e7f912159e0b2484416cbe1a2f75 Mon Sep 17 00:00:00 2001 From: Rui-Sun Date: Fri, 20 Dec 2024 18:06:43 +0800 Subject: [PATCH] fix: fix no records in initRecordCheckState() --- packages/vtable/src/state/checkbox/checkbox.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/vtable/src/state/checkbox/checkbox.ts b/packages/vtable/src/state/checkbox/checkbox.ts index 3241a2aa8..033890484 100644 --- a/packages/vtable/src/state/checkbox/checkbox.ts +++ b/packages/vtable/src/state/checkbox/checkbox.ts @@ -347,7 +347,13 @@ function initRecordCheckState(records: any[], state: StateManager) { : table.internalProps.transpose ? table.rowHeaderLevelCount : table.columnHeaderLevelCount; - const end = table.isPivotTable() ? records.length : table.internalProps.transpose ? table.colCount : table.rowCount; + const end = table.isPivotTable() + ? isArray(records) + ? records.length + : 0 + : table.internalProps.transpose + ? table.colCount + : table.rowCount; for (let index = 0; index + start < end; index++) { const record = table.isPivotTable() ? records[index] : table.dataSource.get(index); // eslint-disable-next-line no-loop-func