MCPcopy
hub / github.com/fanmingming/live / renderSlot

Function renderSlot

m3u8/vue.js:2673–2703  ·  view source on GitHub ↗

* Runtime helper for rendering

(
    name,
    fallback,
    props,
    bindObject
  )

Source from the content-addressed store, hash-verified

2671 * Runtime helper for rendering <slot>
2672 */
2673 function renderSlot (
2674 name,
2675 fallback,
2676 props,
2677 bindObject
2678 ) {
2679 var scopedSlotFn = this.$scopedSlots[name];
2680 var nodes;
2681 if (scopedSlotFn) { // scoped slot
2682 props = props || {};
2683 if (bindObject) {
2684 if (!isObject(bindObject)) {
2685 warn(
2686 'slot v-bind without argument expects an Object',
2687 this
2688 );
2689 }
2690 props = extend(extend({}, bindObject), props);
2691 }
2692 nodes = scopedSlotFn(props) || fallback;
2693 } else {
2694 nodes = this.$slots[name] || fallback;
2695 }
2696
2697 var target = props && props.slot;
2698 if (target) {
2699 return this.$createElement('template', { slot: target }, nodes)
2700 } else {
2701 return nodes
2702 }
2703 }
2704
2705 /* */
2706

Callers

nothing calls this directly

Calls 3

isObjectFunction · 0.85
warnFunction · 0.85
extendFunction · 0.85

Tested by

no test coverage detected