From f0380001576508fa83e59d783d0ab44a6ea827fe Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 1 Jun 2021 10:08:28 -0400 Subject: [PATCH] refactor: check is function for fallback slots --- src/core/instance/render-helpers/render-slot.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/instance/render-helpers/render-slot.js b/src/core/instance/render-helpers/render-slot.js index b89f44f7..c0a86608 100644 --- a/src/core/instance/render-helpers/render-slot.js +++ b/src/core/instance/render-helpers/render-slot.js @@ -24,13 +24,11 @@ export function renderSlot ( } nodes = scopedSlotFn(props) || - (fallbackRender && - (Array.isArray(fallbackRender) ? fallbackRender : fallbackRender())) + (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender) } else { nodes = this.$slots[name] || - (fallbackRender && - (Array.isArray(fallbackRender) ? fallbackRender : fallbackRender())) + (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender) } const target = props && props.slot