Skip to content

Commit

Permalink
build: build 2.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Feb 4, 2019
1 parent 9b33f20 commit 076dc8d
Show file tree
Hide file tree
Showing 19 changed files with 572 additions and 389 deletions.
115 changes: 68 additions & 47 deletions dist/vue.common.dev.js
@@ -1,5 +1,5 @@
/*!
* Vue.js v2.6.0-beta.3
* Vue.js v2.6.0
* (c) 2014-2019 Evan You
* Released under the MIT License.
*/
Expand Down Expand Up @@ -2752,7 +2752,7 @@ function resolveScopedSlots (
var slot = fns[i];
if (Array.isArray(slot)) {
resolveScopedSlots(slot, hasDynamicKeys, res);
} else {
} else if (slot) {
res[slot.key] = slot.fn;
}
}
Expand Down Expand Up @@ -3899,7 +3899,7 @@ function normalizeScopedSlots (
}
}
res._normalized = true;
res.$stable = slots && slots.$stable;
res.$stable = slots ? slots.$stable : true;
return res
}

Expand Down Expand Up @@ -5319,7 +5319,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
value: FunctionalRenderContext
});

Vue.version = '2.6.0-beta.3';
Vue.version = '2.6.0';

/* */

Expand All @@ -5340,6 +5340,17 @@ var mustUseProp = function (tag, type, attr) {

var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');

var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only');

var convertEnumeratedValue = function (key, value) {
return isFalsyAttrValue(value) || value === 'false'
? 'false'
// allow arbitrary string value for contenteditable
: key === 'contenteditable' && isValidContentEditableValue(value)
? value
: 'true'
};

var isBooleanAttr = makeMap(
'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' +
'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
Expand Down Expand Up @@ -6607,7 +6618,7 @@ function setAttr (el, key, value) {
el.setAttribute(key, value);
}
} else if (isEnumeratedAttr(key)) {
el.setAttribute(key, isFalsyAttrValue(value) || value === 'false' ? 'false' : 'true');
el.setAttribute(key, convertEnumeratedValue(key, value));
} else if (isXlink(key)) {
if (isFalsyAttrValue(value)) {
el.removeAttributeNS(xlinkNS, getXlinkProp(key));
Expand Down Expand Up @@ -7622,7 +7633,7 @@ var setProp = function (el, name, val) {
if (cssVarRE.test(name)) {
el.style.setProperty(name, val);
} else if (importantRE.test(val)) {
el.style.setProperty(name, val.replace(importantRE, ''), 'important');
el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important');
} else {
var normalizedName = normalize(name);
if (Array.isArray(val)) {
Expand Down Expand Up @@ -9380,15 +9391,14 @@ function parseHTML (html, options) {
/* */

var onRE = /^@|^v-on:/;
var dirRE = /^v-|^@|^:|^\./;
var dirRE = /^v-|^@|^:/;
var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
var stripParensRE = /^\(|\)$/g;
var dynamicArgRE = /^\[.*\]$/;

var argRE = /:(.*)$/;
var bindRE = /^:|^\.|^v-bind:/;
var propBindRE = /^\./;
var modifierRE = /\.[^.]+/g;

var slotRE = /^v-slot(:|$)|^#/;
Expand Down Expand Up @@ -9465,6 +9475,7 @@ function parse (
}

function closeElement (element) {
trimEndingWhitespace(element);
if (!inVPre && !element.processed) {
element = processElement(element, options);
}
Expand All @@ -9491,14 +9502,25 @@ function parse (
if (currentParent && !element.forbidden) {
if (element.elseif || element.else) {
processIfConditions(element, currentParent);
} else if (element.slotScope) { // scoped slot
var name = element.slotTarget || '"default"'
;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
} else {
if (element.slotScope) {
// scoped slot
// keep it in the children list so that v-else(-if) conditions can
// find it as the prev node.
var name = element.slotTarget || '"default"'
;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element;
}
currentParent.children.push(element);
element.parent = currentParent;
}
}

// final children cleanup
// filter out scoped slots
element.children = element.children.filter(function (c) { return !(c).slotScope; });
// remove trailing whitespace node again
trimEndingWhitespace(element);

// check pre state
if (element.pre) {
inVPre = false;
Expand All @@ -9512,6 +9534,20 @@ function parse (
}
}

function trimEndingWhitespace (el) {
// remove trailing whitespace node
if (!inPre) {
var lastNode;
while (
(lastNode = el.children[el.children.length - 1]) &&
lastNode.type === 3 &&
lastNode.text === ' '
) {
el.children.pop();
}
}
}

function checkRootConstraints (el) {
if (el.tag === 'slot' || el.tag === 'template') {
warnOnce(
Expand Down Expand Up @@ -9626,13 +9662,6 @@ function parse (

end: function end (tag, start, end$1) {
var element = stack[stack.length - 1];
if (!inPre) {
// remove trailing whitespace node
var lastNode = element.children[element.children.length - 1];
if (lastNode && lastNode.type === 3 && lastNode.text === ' ') {
element.children.pop();
}
}
// pop stack
stack.length -= 1;
currentParent = stack[stack.length - 1];
Expand Down Expand Up @@ -9976,6 +10005,13 @@ function processSlotContent (el) {
el
);
}
if (el.parent && !maybeComponent(el.parent)) {
warn$2(
"<template v-slot> can only appear at the root level inside " +
"the receiving the component",
el
);
}
}
var ref = getSlotName(slotBinding);
var name = ref.name;
Expand Down Expand Up @@ -10015,8 +10051,9 @@ function processSlotContent (el) {
var name$1 = ref$1.name;
var dynamic$1 = ref$1.dynamic;
var slotContainer = slots[name$1] = createASTElement('template', [], el);
slotContainer.slotTarget = name$1;
slotContainer.slotTargetDynamic = dynamic$1;
slotContainer.children = el.children;
slotContainer.children = el.children.filter(function (c) { return !(c).slotScope; });
slotContainer.slotScope = slotBinding$1.value || "_";
// remove children as they are returned from scopedSlots now
el.children = [];
Expand Down Expand Up @@ -10083,10 +10120,7 @@ function processAttrs (el) {
// modifiers
modifiers = parseModifiers(name.replace(dirRE, ''));
// support .foo shorthand syntax for the .prop modifier
if (propBindRE.test(name)) {
(modifiers || (modifiers = {})).prop = true;
name = "." + name.slice(1).replace(modifierRE, '');
} else if (modifiers) {
if (modifiers) {
name = name.replace(modifierRE, '');
}
if (bindRE.test(name)) { // v-bind
Expand Down Expand Up @@ -11023,43 +11057,30 @@ function genScopedSlots (
slots,
state
) {
var hasDynamicKeys = Object.keys(slots).some(function (key) { return slots[key].slotTargetDynamic; });
var hasDynamicKeys = Object.keys(slots).some(function (key) {
var slot = slots[key];
return slot.slotTargetDynamic || slot.if || slot.for
});
return ("scopedSlots:_u([" + (Object.keys(slots).map(function (key) {
return genScopedSlot(key, slots[key], state)
return genScopedSlot(slots[key], state)
}).join(',')) + "]" + (hasDynamicKeys ? ",true" : "") + ")")
}

function genScopedSlot (
key,
el,
state
) {
if (el.if && !el.ifProcessed) {
return genIf(el, state, genScopedSlot, "null")
}
if (el.for && !el.forProcessed) {
return genForScopedSlot(key, el, state)
return genFor(el, state, genScopedSlot)
}
var fn = "function(" + (String(el.slotScope)) + "){" +
"return " + (el.tag === 'template'
? el.if
? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined")
: genChildren(el, state) || 'undefined'
? genChildren(el, state) || 'undefined'
: genElement(el, state)) + "}";
return ("{key:" + key + ",fn:" + fn + "}")
}

function genForScopedSlot (
key,
el,
state
) {
var exp = el.for;
var alias = el.alias;
var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
el.forProcessed = true; // avoid recursion
return "_l((" + exp + ")," +
"function(" + alias + iterator1 + iterator2 + "){" +
"return " + (genScopedSlot(key, el, state)) +
'})'
return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + "}")
}

function genChildren (
Expand Down
4 changes: 2 additions & 2 deletions dist/vue.common.prod.js

Large diffs are not rendered by default.

0 comments on commit 076dc8d

Please sign in to comment.