Permalink
Browse files

[build] 2.1.8

  • Loading branch information...
1 parent fcc98d5 commit 2856544afd58ca90e84fdd5db5efe2df229443aa @yyx990803 yyx990803 committed Dec 28, 2016
View
@@ -1,5 +1,5 @@
/*!
- * Vue.js v2.1.7
+ * Vue.js v2.1.8
* (c) 2014-2016 Evan You
* Released under the MIT License.
*/
@@ -82,10 +82,10 @@ function isPrimitive (value) {
*/
function cached (fn) {
var cache = Object.create(null);
- return function cachedFn (str) {
+ return (function cachedFn (str) {
var hit = cache[str];
return hit || (cache[str] = fn(str))
- }
+ })
}
/**
@@ -1300,7 +1300,7 @@ function assertProp (
}
for (var i = 0; i < type.length && !valid; i++) {
var assertedType = assertType(value, type[i]);
- expectedTypes.push(assertedType.expectedType);
+ expectedTypes.push(assertedType.expectedType || '');
valid = assertedType.valid;
}
}
@@ -1791,9 +1791,8 @@ Watcher.prototype.teardown = function teardown () {
if (this.active) {
// remove self from vm's watcher list
// this is a somewhat expensive operation so we skip it
- // if the vm is being destroyed or is performing a v-for
- // re-render (the watcher list is then filtered by v-for).
- if (!this.vm._isBeingDestroyed && !this.vm._vForRemoving) {
+ // if the vm is being destroyed.
+ if (!this.vm._isBeingDestroyed) {
remove$1(this.vm._watchers, this);
}
var i = this.deps.length;
@@ -1933,6 +1932,14 @@ var computedSharedDefinition = {
function initComputed (vm, computed) {
for (var key in computed) {
+ /* istanbul ignore if */
+ if (process.env.NODE_ENV !== 'production' && key in vm) {
+ warn(
+ "existing instance property \"" + key + "\" will be " +
+ "overwritten by a computed property with the same name.",
+ vm
+ );
+ }
var userDef = computed[key];
if (typeof userDef === 'function') {
computedSharedDefinition.get = makeComputedGetter(userDef, vm);
@@ -3651,7 +3658,7 @@ Object.defineProperty(Vue$3.prototype, '$isServer', {
get: isServerRendering
});
-Vue$3.version = '2.1.7';
+Vue$3.version = '2.1.8';
/* */
@@ -4478,6 +4485,8 @@ function createPatchFunction (backend) {
}
}
}
+ } else if (elm.data !== vnode.text) {
+ elm.data = vnode.text;
}
return true
}
@@ -4489,7 +4498,7 @@ function createPatchFunction (backend) {
vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase())
)
} else {
- return _toString(vnode.text) === node.data
+ return node.nodeType === (vnode.isComment ? 8 : 3)
}
}
@@ -5273,8 +5282,10 @@ function enter (vnode, toggleDisplay) {
var css = data.css;
var type = data.type;
var enterClass = data.enterClass;
+ var enterToClass = data.enterToClass;
var enterActiveClass = data.enterActiveClass;
var appearClass = data.appearClass;
+ var appearToClass = data.appearToClass;
var appearActiveClass = data.appearActiveClass;
var beforeEnter = data.beforeEnter;
var enter = data.enter;
@@ -5304,6 +5315,7 @@ function enter (vnode, toggleDisplay) {
var startClass = isAppear ? appearClass : enterClass;
var activeClass = isAppear ? appearActiveClass : enterActiveClass;
+ var toClass = isAppear ? appearToClass : enterToClass;
var beforeEnterHook = isAppear ? (beforeAppear || beforeEnter) : beforeEnter;
var enterHook = isAppear ? (typeof appear === 'function' ? appear : enter) : enter;
var afterEnterHook = isAppear ? (afterAppear || afterEnter) : afterEnter;
@@ -5318,6 +5330,7 @@ function enter (vnode, toggleDisplay) {
var cb = el._enterCb = once(function () {
if (expectsCSS) {
+ removeTransitionClass(el, toClass);
removeTransitionClass(el, activeClass);
}
if (cb.cancelled) {
@@ -5350,9 +5363,10 @@ function enter (vnode, toggleDisplay) {
beforeEnterHook && beforeEnterHook(el);
if (expectsCSS) {
addTransitionClass(el, startClass);
+ addTransitionClass(el, activeClass);
nextFrame(function () {
+ addTransitionClass(el, toClass);
removeTransitionClass(el, startClass);
- addTransitionClass(el, activeClass);
if (!cb.cancelled && !userWantsControl) {
whenTransitionEnds(el, type, cb);
}
@@ -5391,6 +5405,7 @@ function leave (vnode, rm) {
var css = data.css;
var type = data.type;
var leaveClass = data.leaveClass;
+ var leaveToClass = data.leaveToClass;
var leaveActiveClass = data.leaveActiveClass;
var beforeLeave = data.beforeLeave;
var leave = data.leave;
@@ -5410,6 +5425,7 @@ function leave (vnode, rm) {
el.parentNode._pending[vnode.key] = null;
}
if (expectsCSS) {
+ removeTransitionClass(el, leaveToClass);
removeTransitionClass(el, leaveActiveClass);
}
if (cb.cancelled) {
@@ -5442,9 +5458,10 @@ function leave (vnode, rm) {
beforeLeave && beforeLeave(el);
if (expectsCSS) {
addTransitionClass(el, leaveClass);
+ addTransitionClass(el, leaveActiveClass);
nextFrame(function () {
+ addTransitionClass(el, leaveToClass);
removeTransitionClass(el, leaveClass);
- addTransitionClass(el, leaveActiveClass);
if (!cb.cancelled && !userWantsControl) {
whenTransitionEnds(el, type, cb);
}
@@ -5479,6 +5496,9 @@ var autoCssTransition = cached(function (name) {
enterClass: (name + "-enter"),
leaveClass: (name + "-leave"),
appearClass: (name + "-enter"),
+ enterToClass: (name + "-enter-to"),
+ leaveToClass: (name + "-leave-to"),
+ appearToClass: (name + "-enter-to"),
enterActiveClass: (name + "-enter-active"),
leaveActiveClass: (name + "-leave-active"),
appearActiveClass: (name + "-enter-active")
@@ -5746,10 +5766,13 @@ var transitionProps = {
type: String,
enterClass: String,
leaveClass: String,
+ enterToClass: String,
+ leaveToClass: String,
enterActiveClass: String,
leaveActiveClass: String,
appearClass: String,
- appearActiveClass: String
+ appearActiveClass: String,
+ appearToClass: String
};
// in case the child is also an abstract component, e.g. <keep-alive>
@@ -5793,6 +5816,10 @@ function hasParentTransition (vnode) {
}
}
+function isSameChild (child, oldChild) {
+ return oldChild.key === child.key && oldChild.tag === child.tag
+}
+
var Transition = {
name: 'transition',
props: transitionProps,
@@ -5865,11 +5892,10 @@ var Transition = {
child.data.show = true;
}
- if (oldChild && oldChild.data && oldChild.key !== key) {
+ if (oldChild && oldChild.data && !isSameChild(child, oldChild)) {
// replace old child transition data with fresh one
// important for dynamic transitions!
- var oldData = oldChild.data.transition = extend({}, data);
-
+ var oldData = oldChild && (oldChild.data.transition = extend({}, data));
// handle transition mode
if (mode === 'out-in') {
// return placeholder node and queue update when leave finishes
@@ -6080,6 +6106,15 @@ Vue$3.prototype.$mount = function (
return this._mount(el, hydrating)
};
+if (process.env.NODE_ENV !== 'production' &&
+ inBrowser && typeof console !== 'undefined') {
+ console[console.info ? 'info' : 'log'](
+ "You are running Vue in development mode.\n" +
+ "Make sure to turn on production mode when deploying for production.\n" +
+ "See more tips at https://vuejs.org/guide/deployment.html"
+ );
+}
+
// devtools global hook
/* istanbul ignore next */
setTimeout(function () {
@@ -6090,8 +6125,8 @@ setTimeout(function () {
process.env.NODE_ENV !== 'production' &&
inBrowser && !isEdge && /Chrome\/\d+/.test(window.navigator.userAgent)
) {
- console.log(
- 'Download the Vue Devtools for a better development experience:\n' +
+ console[console.info ? 'info' : 'log'](
+ 'Download the Vue Devtools extension for a better development experience:\n' +
'https://github.com/vuejs/vue-devtools'
);
}
@@ -7542,6 +7577,8 @@ function bind$2 (el, dir) {
};
}
+/* */
+
var baseDirectives = {
bind: bind$2,
cloak: noop
@@ -7820,23 +7857,25 @@ function genChildren (el, checkSkip) {
}
}
-// determine the normalzation needed for the children array.
+// determine the normalization needed for the children array.
// 0: no normalization needed
// 1: simple normalization needed (possible 1-level deep nested array)
-// 2: full nomralization needed
+// 2: full normalization needed
function getNormalizationType (children) {
+ var res = 0;
for (var i = 0; i < children.length; i++) {
var el = children[i];
if (needsNormalization(el) ||
(el.if && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) {
- return 2
+ res = 2;
+ break
}
if (maybeComponent(el) ||
(el.if && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) {
- return 1
+ res = 1;
}
}
- return 0
+ return res
}
function needsNormalization (el) {
@@ -8141,8 +8180,11 @@ function genCheckboxModel (
var falseValueBinding = getBindingAttr(el, 'false-value') || 'false';
addProp(el, 'checked',
"Array.isArray(" + value + ")" +
- "?_i(" + value + "," + valueBinding + ")>-1" +
- ":_q(" + value + "," + trueValueBinding + ")"
+ "?_i(" + value + "," + valueBinding + ")>-1" + (
+ trueValueBinding === 'true'
+ ? (":(" + value + ")")
+ : (":_q(" + value + "," + trueValueBinding + ")")
+ )
);
addHandler(el, 'change',
"var $$a=" + value + "," +
Oops, something went wrong.

0 comments on commit 2856544

Please sign in to comment.