vue 2.3.2 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vue.common.js +111 -51
- package/dist/vue.esm.js +111 -51
- package/dist/vue.js +109 -49
- package/dist/vue.min.js +4 -4
- package/dist/vue.runtime.common.js +79 -37
- package/dist/vue.runtime.esm.js +79 -37
- package/dist/vue.runtime.js +77 -35
- package/dist/vue.runtime.min.js +3 -3
- package/package.json +1 -1
- package/src/compiler/codegen/events.js +5 -5
- package/src/compiler/codegen/index.js +21 -5
- package/src/compiler/parser/html-parser.js +3 -2
- package/src/compiler/parser/index.js +3 -2
- package/src/core/global-api/mixin.js +1 -0
- package/src/core/global-api/use.js +1 -1
- package/src/core/index.js +1 -0
- package/src/core/instance/index.js +2 -1
- package/src/core/instance/render-helpers/render-list.js +4 -1
- package/src/core/instance/render-helpers/resolve-slots.js +10 -4
- package/src/core/observer/scheduler.js +3 -3
- package/src/core/util/props.js +2 -1
- package/src/core/vdom/create-element.js +2 -1
- package/src/core/vdom/helpers/normalize-children.js +16 -5
- package/src/core/vdom/helpers/resolve-async-component.js +7 -5
- package/src/core/vdom/patch.js +10 -7
- package/src/core/vdom/vnode.js +1 -0
- package/src/platforms/web/runtime/components/transition.js +2 -1
- package/src/platforms/web/runtime/directives/model.js +2 -0
- package/src/platforms/web/runtime/index.js +3 -2
- package/src/platforms/web/runtime/modules/style.js +2 -1
- package/src/platforms/web/runtime/modules/transition.js +3 -2
- package/src/platforms/web/runtime/transition-util.js +4 -2
- package/src/platforms/web/server/modules/dom-props.js +3 -2
- package/src/platforms/weex/runtime/modules/class.js +4 -2
- package/src/platforms/weex/runtime/modules/transition.js +4 -3
- package/src/server/render.js +3 -2
- package/src/server/template-renderer/parse-template.js +1 -1
- package/src/shared/util.js +3 -0
package/dist/vue.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vue.js v2.3.
|
|
2
|
+
* Vue.js v2.3.3
|
|
3
3
|
* (c) 2014-2017 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -21,6 +21,9 @@ function isTrue (v) {
|
|
|
21
21
|
return v === true
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
+
function isFalse (v) {
|
|
25
|
+
return v === false
|
|
26
|
+
}
|
|
24
27
|
/**
|
|
25
28
|
* Check if value is primitive
|
|
26
29
|
*/
|
|
@@ -1416,7 +1419,8 @@ function getPropDefaultValue (vm, prop, key) {
|
|
|
1416
1419
|
// return previous default value to avoid unnecessary watcher trigger
|
|
1417
1420
|
if (vm && vm.$options.propsData &&
|
|
1418
1421
|
vm.$options.propsData[key] === undefined &&
|
|
1419
|
-
vm._props[key] !== undefined
|
|
1422
|
+
vm._props[key] !== undefined
|
|
1423
|
+
) {
|
|
1420
1424
|
return vm._props[key]
|
|
1421
1425
|
}
|
|
1422
1426
|
// call factory function for non-Function types
|
|
@@ -1690,6 +1694,7 @@ function cloneVNode (vnode) {
|
|
|
1690
1694
|
cloned.ns = vnode.ns;
|
|
1691
1695
|
cloned.isStatic = vnode.isStatic;
|
|
1692
1696
|
cloned.key = vnode.key;
|
|
1697
|
+
cloned.isComment = vnode.isComment;
|
|
1693
1698
|
cloned.isCloned = true;
|
|
1694
1699
|
return cloned
|
|
1695
1700
|
}
|
|
@@ -1908,6 +1913,10 @@ function normalizeChildren (children) {
|
|
|
1908
1913
|
: undefined
|
|
1909
1914
|
}
|
|
1910
1915
|
|
|
1916
|
+
function isTextNode (node) {
|
|
1917
|
+
return isDef(node) && isDef(node.text) && isFalse(node.isComment)
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1911
1920
|
function normalizeArrayChildren (children, nestedIndex) {
|
|
1912
1921
|
var res = [];
|
|
1913
1922
|
var i, c, last;
|
|
@@ -1919,18 +1928,25 @@ function normalizeArrayChildren (children, nestedIndex) {
|
|
|
1919
1928
|
if (Array.isArray(c)) {
|
|
1920
1929
|
res.push.apply(res, normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)));
|
|
1921
1930
|
} else if (isPrimitive(c)) {
|
|
1922
|
-
if (
|
|
1923
|
-
|
|
1931
|
+
if (isTextNode(last)) {
|
|
1932
|
+
// merge adjacent text nodes
|
|
1933
|
+
// this is necessary for SSR hydration because text nodes are
|
|
1934
|
+
// essentially merged when rendered to HTML strings
|
|
1935
|
+
(last).text += String(c);
|
|
1924
1936
|
} else if (c !== '') {
|
|
1925
1937
|
// convert primitive to vnode
|
|
1926
1938
|
res.push(createTextVNode(c));
|
|
1927
1939
|
}
|
|
1928
1940
|
} else {
|
|
1929
|
-
if (
|
|
1941
|
+
if (isTextNode(c) && isTextNode(last)) {
|
|
1942
|
+
// merge adjacent text nodes
|
|
1930
1943
|
res[res.length - 1] = createTextVNode(last.text + c.text);
|
|
1931
1944
|
} else {
|
|
1932
1945
|
// default key for nested array children (likely generated by v-for)
|
|
1933
|
-
if (
|
|
1946
|
+
if (isTrue(children._isVList) &&
|
|
1947
|
+
isDef(c.tag) &&
|
|
1948
|
+
isUndef(c.key) &&
|
|
1949
|
+
isDef(nestedIndex)) {
|
|
1934
1950
|
c.key = "__vlist" + nestedIndex + "_" + i + "__";
|
|
1935
1951
|
}
|
|
1936
1952
|
res.push(c);
|
|
@@ -2030,11 +2046,13 @@ function resolveAsyncComponent (
|
|
|
2030
2046
|
|
|
2031
2047
|
if (isDef(res.timeout)) {
|
|
2032
2048
|
setTimeout(function () {
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2049
|
+
if (isUndef(factory.resolved)) {
|
|
2050
|
+
reject(
|
|
2051
|
+
process.env.NODE_ENV !== 'production'
|
|
2052
|
+
? ("timeout (" + (res.timeout) + "ms)")
|
|
2053
|
+
: null
|
|
2054
|
+
);
|
|
2055
|
+
}
|
|
2038
2056
|
}, res.timeout);
|
|
2039
2057
|
}
|
|
2040
2058
|
}
|
|
@@ -2213,7 +2231,8 @@ function resolveSlots (
|
|
|
2213
2231
|
// named slots should only be respected if the vnode was rendered in the
|
|
2214
2232
|
// same context.
|
|
2215
2233
|
if ((child.context === context || child.functionalContext === context) &&
|
|
2216
|
-
|
|
2234
|
+
child.data && child.data.slot != null
|
|
2235
|
+
) {
|
|
2217
2236
|
var name = child.data.slot;
|
|
2218
2237
|
var slot = (slots[name] || (slots[name] = []));
|
|
2219
2238
|
if (child.tag === 'template') {
|
|
@@ -2237,11 +2256,16 @@ function isWhitespace (node) {
|
|
|
2237
2256
|
}
|
|
2238
2257
|
|
|
2239
2258
|
function resolveScopedSlots (
|
|
2240
|
-
fns
|
|
2259
|
+
fns, // see flow/vnode
|
|
2260
|
+
res
|
|
2241
2261
|
) {
|
|
2242
|
-
|
|
2262
|
+
res = res || {};
|
|
2243
2263
|
for (var i = 0; i < fns.length; i++) {
|
|
2244
|
-
|
|
2264
|
+
if (Array.isArray(fns[i])) {
|
|
2265
|
+
resolveScopedSlots(fns[i], res);
|
|
2266
|
+
} else {
|
|
2267
|
+
res[fns[i].key] = fns[i].fn;
|
|
2268
|
+
}
|
|
2245
2269
|
}
|
|
2246
2270
|
return res
|
|
2247
2271
|
}
|
|
@@ -2559,7 +2583,7 @@ var index = 0;
|
|
|
2559
2583
|
* Reset the scheduler's state.
|
|
2560
2584
|
*/
|
|
2561
2585
|
function resetSchedulerState () {
|
|
2562
|
-
queue.length = activatedChildren.length = 0;
|
|
2586
|
+
index = queue.length = activatedChildren.length = 0;
|
|
2563
2587
|
has = {};
|
|
2564
2588
|
if (process.env.NODE_ENV !== 'production') {
|
|
2565
2589
|
circular = {};
|
|
@@ -2669,10 +2693,10 @@ function queueWatcher (watcher) {
|
|
|
2669
2693
|
// if already flushing, splice the watcher based on its id
|
|
2670
2694
|
// if already past its id, it will be run next immediately.
|
|
2671
2695
|
var i = queue.length - 1;
|
|
2672
|
-
while (i
|
|
2696
|
+
while (i > index && queue[i].id > watcher.id) {
|
|
2673
2697
|
i--;
|
|
2674
2698
|
}
|
|
2675
|
-
queue.splice(
|
|
2699
|
+
queue.splice(i + 1, 0, watcher);
|
|
2676
2700
|
}
|
|
2677
2701
|
// queue the flush
|
|
2678
2702
|
if (!waiting) {
|
|
@@ -3575,7 +3599,8 @@ function _createElement (
|
|
|
3575
3599
|
}
|
|
3576
3600
|
// support single function children as default scoped slot
|
|
3577
3601
|
if (Array.isArray(children) &&
|
|
3578
|
-
|
|
3602
|
+
typeof children[0] === 'function'
|
|
3603
|
+
) {
|
|
3579
3604
|
data = data || {};
|
|
3580
3605
|
data.scopedSlots = { default: children[0] };
|
|
3581
3606
|
children.length = 0;
|
|
@@ -3663,6 +3688,9 @@ function renderList (
|
|
|
3663
3688
|
ret[i] = render(val[key], key, i);
|
|
3664
3689
|
}
|
|
3665
3690
|
}
|
|
3691
|
+
if (isDef(ret)) {
|
|
3692
|
+
(ret)._isVList = true;
|
|
3693
|
+
}
|
|
3666
3694
|
return ret
|
|
3667
3695
|
}
|
|
3668
3696
|
|
|
@@ -4062,7 +4090,8 @@ function dedupe (latest, extended, sealed) {
|
|
|
4062
4090
|
|
|
4063
4091
|
function Vue$3 (options) {
|
|
4064
4092
|
if (process.env.NODE_ENV !== 'production' &&
|
|
4065
|
-
!(this instanceof Vue$3)
|
|
4093
|
+
!(this instanceof Vue$3)
|
|
4094
|
+
) {
|
|
4066
4095
|
warn('Vue is a constructor and should be called with the `new` keyword');
|
|
4067
4096
|
}
|
|
4068
4097
|
this._init(options);
|
|
@@ -4080,7 +4109,7 @@ function initUse (Vue) {
|
|
|
4080
4109
|
Vue.use = function (plugin) {
|
|
4081
4110
|
/* istanbul ignore if */
|
|
4082
4111
|
if (plugin.installed) {
|
|
4083
|
-
return
|
|
4112
|
+
return this
|
|
4084
4113
|
}
|
|
4085
4114
|
// additional parameters
|
|
4086
4115
|
var args = toArray(arguments, 1);
|
|
@@ -4100,6 +4129,7 @@ function initUse (Vue) {
|
|
|
4100
4129
|
function initMixin$1 (Vue) {
|
|
4101
4130
|
Vue.mixin = function (mixin) {
|
|
4102
4131
|
this.options = mergeOptions(this.options, mixin);
|
|
4132
|
+
return this
|
|
4103
4133
|
};
|
|
4104
4134
|
}
|
|
4105
4135
|
|
|
@@ -4393,11 +4423,12 @@ Object.defineProperty(Vue$3.prototype, '$isServer', {
|
|
|
4393
4423
|
|
|
4394
4424
|
Object.defineProperty(Vue$3.prototype, '$ssrContext', {
|
|
4395
4425
|
get: function get () {
|
|
4426
|
+
/* istanbul ignore next */
|
|
4396
4427
|
return this.$vnode.ssrContext
|
|
4397
4428
|
}
|
|
4398
4429
|
});
|
|
4399
4430
|
|
|
4400
|
-
Vue$3.version = '2.3.
|
|
4431
|
+
Vue$3.version = '2.3.3';
|
|
4401
4432
|
|
|
4402
4433
|
/* */
|
|
4403
4434
|
|
|
@@ -4978,8 +5009,9 @@ function createPatchFunction (backend) {
|
|
|
4978
5009
|
}
|
|
4979
5010
|
// for slot content they should also get the scopeId from the host instance.
|
|
4980
5011
|
if (isDef(i = activeInstance) &&
|
|
4981
|
-
|
|
4982
|
-
|
|
5012
|
+
i !== vnode.context &&
|
|
5013
|
+
isDef(i = i.$options._scopeId)
|
|
5014
|
+
) {
|
|
4983
5015
|
nodeOps.setAttribute(vnode.elm, i, '');
|
|
4984
5016
|
}
|
|
4985
5017
|
}
|
|
@@ -5131,9 +5163,10 @@ function createPatchFunction (backend) {
|
|
|
5131
5163
|
// if the new node is not cloned it means the render functions have been
|
|
5132
5164
|
// reset by the hot-reload-api and we need to do a proper re-render.
|
|
5133
5165
|
if (isTrue(vnode.isStatic) &&
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5166
|
+
isTrue(oldVnode.isStatic) &&
|
|
5167
|
+
vnode.key === oldVnode.key &&
|
|
5168
|
+
(isTrue(vnode.isCloned) || isTrue(vnode.isOnce))
|
|
5169
|
+
) {
|
|
5137
5170
|
vnode.elm = oldVnode.elm;
|
|
5138
5171
|
vnode.componentInstance = oldVnode.componentInstance;
|
|
5139
5172
|
return
|
|
@@ -5224,8 +5257,9 @@ function createPatchFunction (backend) {
|
|
|
5224
5257
|
// longer than the virtual children list.
|
|
5225
5258
|
if (!childrenMatch || childNode) {
|
|
5226
5259
|
if (process.env.NODE_ENV !== 'production' &&
|
|
5227
|
-
|
|
5228
|
-
|
|
5260
|
+
typeof console !== 'undefined' &&
|
|
5261
|
+
!bailed
|
|
5262
|
+
) {
|
|
5229
5263
|
bailed = true;
|
|
5230
5264
|
console.warn('Parent: ', elm);
|
|
5231
5265
|
console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children);
|
|
@@ -6362,7 +6396,8 @@ function updateStyle (oldVnode, vnode) {
|
|
|
6362
6396
|
var oldData = oldVnode.data;
|
|
6363
6397
|
|
|
6364
6398
|
if (isUndef(data.staticStyle) && isUndef(data.style) &&
|
|
6365
|
-
|
|
6399
|
+
isUndef(oldData.staticStyle) && isUndef(oldData.style)
|
|
6400
|
+
) {
|
|
6366
6401
|
return
|
|
6367
6402
|
}
|
|
6368
6403
|
|
|
@@ -6500,12 +6535,14 @@ var animationEndEvent = 'animationend';
|
|
|
6500
6535
|
if (hasTransition) {
|
|
6501
6536
|
/* istanbul ignore if */
|
|
6502
6537
|
if (window.ontransitionend === undefined &&
|
|
6503
|
-
window.onwebkittransitionend !== undefined
|
|
6538
|
+
window.onwebkittransitionend !== undefined
|
|
6539
|
+
) {
|
|
6504
6540
|
transitionProp = 'WebkitTransition';
|
|
6505
6541
|
transitionEndEvent = 'webkitTransitionEnd';
|
|
6506
6542
|
}
|
|
6507
6543
|
if (window.onanimationend === undefined &&
|
|
6508
|
-
window.onwebkitanimationend !== undefined
|
|
6544
|
+
window.onwebkitanimationend !== undefined
|
|
6545
|
+
) {
|
|
6509
6546
|
animationProp = 'WebkitAnimation';
|
|
6510
6547
|
animationEndEvent = 'webkitAnimationEnd';
|
|
6511
6548
|
}
|
|
@@ -6745,8 +6782,9 @@ function enter (vnode, toggleDisplay) {
|
|
|
6745
6782
|
var parent = el.parentNode;
|
|
6746
6783
|
var pendingNode = parent && parent._pending && parent._pending[vnode.key];
|
|
6747
6784
|
if (pendingNode &&
|
|
6748
|
-
|
|
6749
|
-
|
|
6785
|
+
pendingNode.tag === vnode.tag &&
|
|
6786
|
+
pendingNode.elm._leaveCb
|
|
6787
|
+
) {
|
|
6750
6788
|
pendingNode.elm._leaveCb();
|
|
6751
6789
|
}
|
|
6752
6790
|
enterHook && enterHook(el, cb);
|
|
@@ -7079,6 +7117,8 @@ function onCompositionStart (e) {
|
|
|
7079
7117
|
}
|
|
7080
7118
|
|
|
7081
7119
|
function onCompositionEnd (e) {
|
|
7120
|
+
// prevent triggering an input event for no reason
|
|
7121
|
+
if (!e.target.composing) { return }
|
|
7082
7122
|
e.target.composing = false;
|
|
7083
7123
|
trigger(e.target, 'input');
|
|
7084
7124
|
}
|
|
@@ -7261,7 +7301,8 @@ var Transition = {
|
|
|
7261
7301
|
|
|
7262
7302
|
// warn invalid mode
|
|
7263
7303
|
if (process.env.NODE_ENV !== 'production' &&
|
|
7264
|
-
|
|
7304
|
+
mode && mode !== 'in-out' && mode !== 'out-in'
|
|
7305
|
+
) {
|
|
7265
7306
|
warn(
|
|
7266
7307
|
'invalid <transition> mode: ' + mode,
|
|
7267
7308
|
this.$parent
|
|
@@ -7545,8 +7586,9 @@ setTimeout(function () {
|
|
|
7545
7586
|
}
|
|
7546
7587
|
}
|
|
7547
7588
|
if (process.env.NODE_ENV !== 'production' &&
|
|
7548
|
-
|
|
7549
|
-
|
|
7589
|
+
config.productionTip !== false &&
|
|
7590
|
+
inBrowser && typeof console !== 'undefined'
|
|
7591
|
+
) {
|
|
7550
7592
|
console[console.info ? 'info' : 'log'](
|
|
7551
7593
|
"You are running Vue in development mode.\n" +
|
|
7552
7594
|
"Make sure to turn on production mode when deploying for production.\n" +
|
|
@@ -7879,8 +7921,9 @@ function parseHTML (html, options) {
|
|
|
7879
7921
|
// Close all the open elements, up the stack
|
|
7880
7922
|
for (var i = stack.length - 1; i >= pos; i--) {
|
|
7881
7923
|
if (process.env.NODE_ENV !== 'production' &&
|
|
7882
|
-
|
|
7883
|
-
|
|
7924
|
+
(i > pos || !tagName) &&
|
|
7925
|
+
options.warn
|
|
7926
|
+
) {
|
|
7884
7927
|
options.warn(
|
|
7885
7928
|
("tag <" + (stack[i].tag) + "> has no matching end tag.")
|
|
7886
7929
|
);
|
|
@@ -8175,8 +8218,9 @@ function parse (
|
|
|
8175
8218
|
// IE textarea placeholder bug
|
|
8176
8219
|
/* istanbul ignore if */
|
|
8177
8220
|
if (isIE &&
|
|
8178
|
-
|
|
8179
|
-
|
|
8221
|
+
currentParent.tag === 'textarea' &&
|
|
8222
|
+
currentParent.attrsMap.placeholder === text
|
|
8223
|
+
) {
|
|
8180
8224
|
return
|
|
8181
8225
|
}
|
|
8182
8226
|
var children = currentParent.children;
|
|
@@ -8680,17 +8724,17 @@ var modifierCode = {
|
|
|
8680
8724
|
|
|
8681
8725
|
function genHandlers (
|
|
8682
8726
|
events,
|
|
8683
|
-
|
|
8727
|
+
isNative,
|
|
8684
8728
|
warn
|
|
8685
8729
|
) {
|
|
8686
|
-
var res =
|
|
8730
|
+
var res = isNative ? 'nativeOn:{' : 'on:{';
|
|
8687
8731
|
for (var name in events) {
|
|
8688
8732
|
var handler = events[name];
|
|
8689
8733
|
// #5330: warn click.right, since right clicks do not actually fire click events.
|
|
8690
8734
|
if (process.env.NODE_ENV !== 'production' &&
|
|
8691
|
-
|
|
8692
|
-
|
|
8693
|
-
|
|
8735
|
+
name === 'click' &&
|
|
8736
|
+
handler && handler.modifiers && handler.modifiers.right
|
|
8737
|
+
) {
|
|
8694
8738
|
warn(
|
|
8695
8739
|
"Use \"contextmenu\" instead of \"click.right\" since right clicks " +
|
|
8696
8740
|
"do not actually fire \"click\" events."
|
|
@@ -9045,10 +9089,25 @@ function genScopedSlots (slots) {
|
|
|
9045
9089
|
}
|
|
9046
9090
|
|
|
9047
9091
|
function genScopedSlot (key, el) {
|
|
9048
|
-
|
|
9092
|
+
if (el.for && !el.forProcessed) {
|
|
9093
|
+
return genForScopedSlot(key, el)
|
|
9094
|
+
}
|
|
9095
|
+
return "{key:" + key + ",fn:function(" + (String(el.attrsMap.scope)) + "){" +
|
|
9049
9096
|
"return " + (el.tag === 'template'
|
|
9050
9097
|
? genChildren(el) || 'void 0'
|
|
9051
|
-
: genElement(el)) + "}
|
|
9098
|
+
: genElement(el)) + "}}"
|
|
9099
|
+
}
|
|
9100
|
+
|
|
9101
|
+
function genForScopedSlot (key, el) {
|
|
9102
|
+
var exp = el.for;
|
|
9103
|
+
var alias = el.alias;
|
|
9104
|
+
var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : '';
|
|
9105
|
+
var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : '';
|
|
9106
|
+
el.forProcessed = true; // avoid recursion
|
|
9107
|
+
return "_l((" + exp + ")," +
|
|
9108
|
+
"function(" + alias + iterator1 + iterator2 + "){" +
|
|
9109
|
+
"return " + (genScopedSlot(key, el)) +
|
|
9110
|
+
'})'
|
|
9052
9111
|
}
|
|
9053
9112
|
|
|
9054
9113
|
function genChildren (el, checkSkip) {
|
|
@@ -9057,9 +9116,10 @@ function genChildren (el, checkSkip) {
|
|
|
9057
9116
|
var el$1 = children[0];
|
|
9058
9117
|
// optimize single v-for
|
|
9059
9118
|
if (children.length === 1 &&
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9119
|
+
el$1.for &&
|
|
9120
|
+
el$1.tag !== 'template' &&
|
|
9121
|
+
el$1.tag !== 'slot'
|
|
9122
|
+
) {
|
|
9063
9123
|
return genElement(el$1)
|
|
9064
9124
|
}
|
|
9065
9125
|
var normalizationType = checkSkip ? getNormalizationType(children) : 0;
|