Skip to content

Commit

Permalink
fix: 修复虚拟列表插槽为空时异常
Browse files Browse the repository at this point in the history
  • Loading branch information
wanchun committed Jun 18, 2023
1 parent c507a49 commit 7e79912
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions components/virtual-list/listItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ export const FVirtualListItem = defineComponent({
},
render() {
const { index, source, $slots } = this;

const vNode = getFirstValidNode($slots.default?.({ index, source }));
const vNode = getFirstValidNode(
$slots.default?.({ index, source }) ?? [],
);
if (!vNode) {
return;
}
return cloneVNode(
vNode,
{
Expand Down

0 comments on commit 7e79912

Please sign in to comment.