Skip to content

Commit dc42751

Browse files
committed
fix: Compatible with empty slots for bodyCell
#4855
1 parent 45c0583 commit dc42751

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

components/vc-table/Cell/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,15 @@ export default defineComponent<CellProps>({
162162
index,
163163
column: column.__originColumn__,
164164
},
165-
() => [childNode === undefined ? value : childNode],
165+
() => {
166+
const fallback = childNode === undefined ? value : childNode;
167+
return [
168+
(typeof fallback === 'object' && isValidElement(fallback)) ||
169+
typeof fallback !== 'object'
170+
? fallback
171+
: null,
172+
];
173+
},
166174
);
167175
childNode = flattenChildren(child as any);
168176
}

0 commit comments

Comments
 (0)