|
|
@@ -1,5 +1,5 @@
|
|
|
/*!
|
|
|
- * Vue.js v2.0.6
|
|
|
+ * Vue.js v2.0.7
|
|
|
* (c) 2014-2016 Evan You
|
|
|
* Released under the MIT License.
|
|
|
*/
|
|
|
@@ -775,9 +775,11 @@ function defineReactive$$1 (
|
|
|
},
|
|
|
set: function reactiveSetter (newVal) {
|
|
|
var value = getter ? getter.call(obj) : val;
|
|
|
- if (newVal === value) {
|
|
|
+ /* eslint-disable no-self-compare */
|
|
|
+ if (newVal === value || (newVal !== newVal && value !== value)) {
|
|
|
return
|
|
|
}
|
|
|
+ /* eslint-enable no-self-compare */
|
|
|
if (process.env.NODE_ENV !== 'production' && customSetter) {
|
|
|
customSetter();
|
|
|
}
|
|
|
@@ -1790,6 +1792,8 @@ function initState (vm) {
|
|
|
initWatch(vm);
|
|
|
}
|
|
|
|
|
|
+var isReservedProp = makeMap('key,ref,slot');
|
|
|
+
|
|
|
function initProps (vm) {
|
|
|
var props = vm.$options.props;
|
|
|
if (props) {
|
|
|
@@ -1802,6 +1806,12 @@ function initProps (vm) {
|
|
|
var key = keys[i];
|
|
|
/* istanbul ignore else */
|
|
|
if (process.env.NODE_ENV !== 'production') {
|
|
|
+ if (isReservedProp(key)) {
|
|
|
+ warn(
|
|
|
+ ("\"" + key + "\" is a reserved attribute and cannot be used as component prop."),
|
|
|
+ vm
|
|
|
+ );
|
|
|
+ }
|
|
|
defineReactive$$1(vm, key, validateProp(key, props, propsData, vm), function () {
|
|
|
if (vm.$parent && !observerState.isSettingProps) {
|
|
|
warn(
|
|
|
@@ -2570,6 +2580,10 @@ function init (vnode, hydrating) {
|
|
|
if (!vnode.child || vnode.child._isDestroyed) {
|
|
|
var child = vnode.child = createComponentInstanceForVnode(vnode, activeInstance);
|
|
|
child.$mount(hydrating ? vnode.elm : undefined, hydrating);
|
|
|
+ } else if (vnode.data.keepAlive) {
|
|
|
+ // kept-alive components, treat as a patch
|
|
|
+ var mountedNode = vnode; // work around flow
|
|
|
+ prepatch(mountedNode, mountedNode);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -2761,6 +2775,13 @@ function _createElement (
|
|
|
// in case of component :is set to falsy value
|
|
|
return emptyVNode()
|
|
|
}
|
|
|
+ // support single function children as default scoped slot
|
|
|
+ if (Array.isArray(children) &&
|
|
|
+ typeof children[0] === 'function') {
|
|
|
+ data = data || {};
|
|
|
+ data.scopedSlots = { default: children[0] };
|
|
|
+ children.length = 0;
|
|
|
+ }
|
|
|
if (typeof tag === 'string') {
|
|
|
var Ctor;
|
|
|
var ns = config.getTagNamespace(tag);
|
|
|
@@ -2797,6 +2818,7 @@ function initRender (vm) {
|
|
|
vm._staticTrees = null;
|
|
|
vm._renderContext = vm.$options._parentVnode && vm.$options._parentVnode.context;
|
|
|
vm.$slots = resolveSlots(vm.$options._renderChildren, vm._renderContext);
|
|
|
+ vm.$scopedSlots = null;
|
|
|
// bind the public createElement fn to this instance
|
|
|
// so that we get proper render context inside it.
|
|
|
vm.$createElement = bind$1(createElement, vm);
|
|
|
@@ -2824,6 +2846,10 @@ function renderMixin (Vue) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if (_parentVnode) {
|
|
|
+ vm.$scopedSlots = _parentVnode.data.scopedSlots;
|
|
|
+ }
|
|
|
+
|
|
|
if (staticRenderFns && !vm._staticTrees) {
|
|
|
vm._staticTrees = [];
|
|
|
}
|
|
|
@@ -2963,24 +2989,31 @@ function renderMixin (Vue) {
|
|
|
// renderSlot
|
|
|
Vue.prototype._t = function (
|
|
|
name,
|
|
|
- fallback
|
|
|
+ fallback,
|
|
|
+ props
|
|
|
) {
|
|
|
- var slotNodes = this.$slots[name];
|
|
|
- // warn duplicate slot usage
|
|
|
- if (slotNodes && process.env.NODE_ENV !== 'production') {
|
|
|
- slotNodes._rendered && warn(
|
|
|
- "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
|
|
|
- "- this will likely cause render errors.",
|
|
|
- this
|
|
|
- );
|
|
|
- slotNodes._rendered = true;
|
|
|
+ var scopedSlotFn = this.$scopedSlots && this.$scopedSlots[name];
|
|
|
+ if (scopedSlotFn) { // scoped slot
|
|
|
+ return scopedSlotFn(props || {}) || fallback
|
|
|
+ } else {
|
|
|
+ var slotNodes = this.$slots[name];
|
|
|
+ // warn duplicate slot usage
|
|
|
+ if (slotNodes && process.env.NODE_ENV !== 'production') {
|
|
|
+ slotNodes._rendered && warn(
|
|
|
+ "Duplicate presence of slot \"" + name + "\" found in the same render tree " +
|
|
|
+ "- this will likely cause render errors.",
|
|
|
+ this
|
|
|
+ );
|
|
|
+ slotNodes._rendered = true;
|
|
|
+ }
|
|
|
+ return slotNodes || fallback
|
|
|
}
|
|
|
- return slotNodes || fallback
|
|
|
};
|
|
|
|
|
|
// apply v-bind object
|
|
|
Vue.prototype._b = function bindProps (
|
|
|
data,
|
|
|
+ tag,
|
|
|
value,
|
|
|
asProp
|
|
|
) {
|
|
|
@@ -2998,7 +3031,7 @@ function renderMixin (Vue) {
|
|
|
if (key === 'class' || key === 'style') {
|
|
|
data[key] = value[key];
|
|
|
} else {
|
|
|
- var hash = asProp || config.mustUseProp(key)
|
|
|
+ var hash = asProp || config.mustUseProp(tag, key)
|
|
|
? data.domProps || (data.domProps = {})
|
|
|
: data.attrs || (data.attrs = {});
|
|
|
hash[key] = value[key];
|
|
|
@@ -3431,12 +3464,19 @@ Object.defineProperty(Vue$2.prototype, '$isServer', {
|
|
|
get: isServerRendering
|
|
|
});
|
|
|
|
|
|
-Vue$2.version = '2.0.6';
|
|
|
+Vue$2.version = '2.0.7';
|
|
|
|
|
|
/* */
|
|
|
|
|
|
// attributes that should be using props for binding
|
|
|
-var mustUseProp = makeMap('value,selected,checked,muted');
|
|
|
+var mustUseProp = function (tag, attr) {
|
|
|
+ return (
|
|
|
+ (attr === 'value' && (tag === 'input' || tag === 'textarea' || tag === 'option')) ||
|
|
|
+ (attr === 'selected' && tag === 'option') ||
|
|
|
+ (attr === 'checked' && tag === 'input') ||
|
|
|
+ (attr === 'muted' && tag === 'video')
|
|
|
+ )
|
|
|
+};
|
|
|
|
|
|
var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck');
|
|
|
|
|
|
@@ -3780,7 +3820,7 @@ function registerRef (vnode, isRemoval) {
|
|
|
}
|
|
|
} else {
|
|
|
if (vnode.data.refInFor) {
|
|
|
- if (Array.isArray(refs[key])) {
|
|
|
+ if (Array.isArray(refs[key]) && refs[key].indexOf(ref) < 0) {
|
|
|
refs[key].push(ref);
|
|
|
} else {
|
|
|
refs[key] = [ref];
|
|
|
@@ -4570,13 +4610,14 @@ function updateDOMProps (oldVnode, vnode) {
|
|
|
}
|
|
|
}
|
|
|
for (key in props) {
|
|
|
+ cur = props[key];
|
|
|
// ignore children if the node has textContent or innerHTML,
|
|
|
// as these will throw away existing DOM nodes and cause removal errors
|
|
|
// on subsequent patches (#3360)
|
|
|
- if ((key === 'textContent' || key === 'innerHTML') && vnode.children) {
|
|
|
- vnode.children.length = 0;
|
|
|
+ if (key === 'textContent' || key === 'innerHTML') {
|
|
|
+ if (vnode.children) { vnode.children.length = 0; }
|
|
|
+ if (cur === oldProps[key]) { continue }
|
|
|
}
|
|
|
- cur = props[key];
|
|
|
if (key === 'value') {
|
|
|
// store value as _value as well since
|
|
|
// non-string values will be stringified
|
|
|
@@ -4707,7 +4748,12 @@ function updateStyle (oldVnode, vnode) {
|
|
|
|
|
|
var cur, name;
|
|
|
var el = vnode.elm;
|
|
|
- var oldStyle = oldVnode.data.style || {};
|
|
|
+ var oldStaticStyle = oldVnode.data.staticStyle;
|
|
|
+ var oldStyleBinding = oldVnode.data.style || {};
|
|
|
+
|
|
|
+ // if static style exists, stylebinding already merged into it when doing normalizeStyleData
|
|
|
+ var oldStyle = oldStaticStyle || oldStyleBinding;
|
|
|
+
|
|
|
var style = normalizeStyleBinding(vnode.data.style) || {};
|
|
|
|
|
|
vnode.data.style = style.__ob__ ? extend({}, style) : style;
|
|
|
@@ -5626,7 +5672,7 @@ var TransitionGroup = {
|
|
|
|
|
|
updated: function updated () {
|
|
|
var children = this.prevChildren;
|
|
|
- var moveClass = this.moveClass || (this.name + '-move');
|
|
|
+ var moveClass = this.moveClass || ((this.name || 'v') + '-move');
|
|
|
if (!children.length || !this.hasMove(children[0].elm, moveClass)) {
|
|
|
return
|
|
|
}
|