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 =
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

Loading…
Cancel
Save