fix: Compatible with empty slots for bodyCell

#4855
pull/4865/head
tangjinzhou 2021-11-08 21:59:14 +08:00
parent 45c0583426
commit dc4275129b
1 changed files with 9 additions and 1 deletions

View File

@ -162,7 +162,15 @@ export default defineComponent<CellProps>({
index,
column: column.__originColumn__,
},
() => [childNode === undefined ? value : childNode],
() => {
const fallback = childNode === undefined ? value : childNode;
return [
(typeof fallback === 'object' && isValidElement(fallback)) ||
typeof fallback !== 'object'
? fallback
: null,
];
},
);
childNode = flattenChildren(child as any);
}