Browse Source

refactor: check is function for fallback slots

dev
Evan You 4 years ago
parent
commit
f038000157
  1. 6
      src/core/instance/render-helpers/render-slot.js

6
src/core/instance/render-helpers/render-slot.js

@ -24,13 +24,11 @@ export function renderSlot (
} }
nodes = nodes =
scopedSlotFn(props) || scopedSlotFn(props) ||
(fallbackRender && (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender)
(Array.isArray(fallbackRender) ? fallbackRender : fallbackRender()))
} else { } else {
nodes = nodes =
this.$slots[name] || this.$slots[name] ||
(fallbackRender && (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender)
(Array.isArray(fallbackRender) ? fallbackRender : fallbackRender()))
} }
const target = props && props.slot const target = props && props.slot

Loading…
Cancel
Save