dist/app.js
/**
 * Scan and determine slot content distribution.
 * We do this during transclusion instead at compile time so that
 * the distribution is decoupled from the compilation order of
 * the slots.
 *
 * @param {Element|DocumentFragment} template
 * @param {Element} content
 * @param {Vue} vm
 */
Scan and determine slot content distribution.
We do this during transclusion instead at compile time so that
the distribution is decoupled from the compilation order of
the slots.

@param {Element|DocumentFragment} template
@param {Element} content
@param {Vue} vm
Scan and determine slot content distribution . We do this during transclusion instead at compile time so that the distribution is decoupled from the compilation order of the slots . @param { Element|DocumentFragment } template @param { Element } content @param { Vue } vm
function scanSlots(template, content, vm) {
  if (!content) {
    return;
  }
  var contents = vm._slotContents = {};
  var slots = template.querySelectorAll('slot');
  if (slots.length) {
    var hasDefault, slot, name;
    for (var i = 0, l = slots.length; i < l; i++) {
      slot = slots[i];
      if (name = slot.getAttribute('name')) {
        select(slot, name);
      } else if (process.env.NODE_ENV !== 'production' && (name = getBindAttr(slot, 'name'))) {
        warn('<slot :name="' + name + '">: slot names cannot be dynamic.');
      } else {
        hasDefault = true;
      }
    }
    if (hasDefault) {
      contents['default'] = extractFragment(content.childNodes, content);
    }
  }
  function select(slot, name) {
    var selector = '[slot="' + name + '"]';
    var nodes = content.querySelectorAll(selector);
    if (nodes.length) {
      contents[name] = extractFragment(nodes, content);
    }
  }
}
function scanSlots ( template , content , vm ) { if ( ! content ) { return ; } var contents = vm . _slotContents = { } ; var slots = template . querySelectorAll ( 'slot' ) ; if ( slots . length ) { var hasDefault , slot , name ; for ( var i = 0 , l = slots . length ; i < l ; i ++ ) { slot = slots [ i ] ; if ( name = slot . getAttribute ( 'name' ) ) { select ( slot , name ) ; } else if ( process . env . NODE_ENV !== 'production' && ( name = getBindAttr ( slot , 'name' ) ) ) { warn ( '<slot :name="' + name + '">: slot names cannot be dynamic.' ) ; } else { hasDefault = true ; } } if ( hasDefault ) { contents [ 'default' ] = extractFragment ( content . childNodes , content ) ; } } function select ( slot , name ) { var selector = '[slot="' + name + '"]' ; var nodes = content . querySelectorAll ( selector ) ; if ( nodes . length ) { contents [ name ] = extractFragment ( nodes , content ) ; } } }
Scan and determine slot content distribution.
Scan and determine slot content distribution .
/* eslint-disable no-cond-assign */ // default slot /* eslint-enable no-cond-assign */ // named slot