vue 2.6.9 → 2.6.13
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/README.md +133 -74
- package/dist/README.md +2 -4
- package/dist/vue.common.dev.js +195 -107
- package/dist/vue.common.prod.js +3 -3
- package/dist/vue.esm.browser.js +189 -107
- package/dist/vue.esm.browser.min.js +3 -3
- package/dist/vue.esm.js +195 -107
- package/dist/vue.js +195 -107
- package/dist/vue.min.js +3 -3
- package/dist/vue.runtime.common.dev.js +159 -91
- package/dist/vue.runtime.common.prod.js +3 -3
- package/dist/vue.runtime.esm.js +159 -91
- package/dist/vue.runtime.js +159 -91
- package/dist/vue.runtime.min.js +3 -3
- package/package.json +5 -5
- package/src/compiler/codegen/events.js +3 -3
- package/src/compiler/codegen/index.js +3 -2
- package/src/compiler/error-detector.js +18 -3
- package/src/compiler/parser/html-parser.js +3 -3
- package/src/compiler/parser/index.js +11 -7
- package/src/core/components/keep-alive.js +42 -14
- package/src/core/instance/lifecycle.js +2 -1
- package/src/core/instance/proxy.js +2 -2
- package/src/core/instance/render-helpers/bind-dynamic-keys.js +2 -2
- package/src/core/instance/render-helpers/check-keycodes.js +1 -0
- package/src/core/instance/render-helpers/render-slot.js +10 -8
- package/src/core/instance/render.js +1 -1
- package/src/core/instance/state.js +8 -6
- package/src/core/observer/scheduler.js +17 -11
- package/src/core/observer/watcher.js +3 -5
- package/src/core/util/env.js +1 -2
- package/src/core/util/next-tick.js +1 -1
- package/src/core/util/props.js +24 -15
- package/src/core/vdom/create-component.js +4 -2
- package/src/core/vdom/create-element.js +6 -0
- package/src/core/vdom/helpers/normalize-scoped-slots.js +5 -3
- package/src/core/vdom/helpers/resolve-async-component.js +14 -2
- package/src/core/vdom/patch.js +6 -6
- package/src/platforms/web/compiler/modules/model.js +1 -1
- package/src/platforms/web/runtime/modules/attrs.js +3 -3
- package/src/platforms/web/runtime/modules/dom-props.js +3 -2
- package/src/platforms/web/server/modules/attrs.js +4 -0
- package/src/platforms/web/server/modules/dom-props.js +2 -2
- package/src/platforms/web/server/util.js +4 -4
- package/src/platforms/web/util/attrs.js +1 -1
- package/src/platforms/web/util/element.js +1 -1
- package/src/server/template-renderer/create-async-file-mapper.js +5 -1
- package/types/index.d.ts +1 -2
- package/types/options.d.ts +3 -3
- package/types/umd.d.ts +48 -0
- package/types/vnode.d.ts +3 -3
- package/types/vue.d.ts +5 -1
- package/src/.DS_Store +0 -0
- package/src/compiler/.DS_Store +0 -0
- package/src/platforms/.DS_Store +0 -0
- package/src/platforms/weex/.DS_Store +0 -0
- package/src/platforms/weex/compiler/.DS_Store +0 -0
package/dist/vue.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Vue.js v2.6.
|
|
3
|
-
* (c) 2014-
|
|
2
|
+
* Vue.js v2.6.13
|
|
3
|
+
* (c) 2014-2021 Evan You
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
6
6
|
(function (global, factory) {
|
|
@@ -1704,13 +1704,14 @@
|
|
|
1704
1704
|
type = [type];
|
|
1705
1705
|
}
|
|
1706
1706
|
for (var i = 0; i < type.length && !valid; i++) {
|
|
1707
|
-
var assertedType = assertType(value, type[i]);
|
|
1707
|
+
var assertedType = assertType(value, type[i], vm);
|
|
1708
1708
|
expectedTypes.push(assertedType.expectedType || '');
|
|
1709
1709
|
valid = assertedType.valid;
|
|
1710
1710
|
}
|
|
1711
1711
|
}
|
|
1712
1712
|
|
|
1713
|
-
|
|
1713
|
+
var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
|
|
1714
|
+
if (!valid && haveExpectedTypes) {
|
|
1714
1715
|
warn(
|
|
1715
1716
|
getInvalidTypeMessage(name, value, expectedTypes),
|
|
1716
1717
|
vm
|
|
@@ -1728,9 +1729,9 @@
|
|
|
1728
1729
|
}
|
|
1729
1730
|
}
|
|
1730
1731
|
|
|
1731
|
-
var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
|
|
1732
|
+
var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
|
|
1732
1733
|
|
|
1733
|
-
function assertType (value, type) {
|
|
1734
|
+
function assertType (value, type, vm) {
|
|
1734
1735
|
var valid;
|
|
1735
1736
|
var expectedType = getType(type);
|
|
1736
1737
|
if (simpleCheckRE.test(expectedType)) {
|
|
@@ -1745,7 +1746,12 @@
|
|
|
1745
1746
|
} else if (expectedType === 'Array') {
|
|
1746
1747
|
valid = Array.isArray(value);
|
|
1747
1748
|
} else {
|
|
1748
|
-
|
|
1749
|
+
try {
|
|
1750
|
+
valid = value instanceof type;
|
|
1751
|
+
} catch (e) {
|
|
1752
|
+
warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
|
|
1753
|
+
valid = false;
|
|
1754
|
+
}
|
|
1749
1755
|
}
|
|
1750
1756
|
return {
|
|
1751
1757
|
valid: valid,
|
|
@@ -1753,13 +1759,15 @@
|
|
|
1753
1759
|
}
|
|
1754
1760
|
}
|
|
1755
1761
|
|
|
1762
|
+
var functionTypeCheckRE = /^\s*function (\w+)/;
|
|
1763
|
+
|
|
1756
1764
|
/**
|
|
1757
1765
|
* Use function string name to check built-in types,
|
|
1758
1766
|
* because a simple equality check will fail when running
|
|
1759
1767
|
* across different vms / iframes.
|
|
1760
1768
|
*/
|
|
1761
1769
|
function getType (fn) {
|
|
1762
|
-
var match = fn && fn.toString().match(
|
|
1770
|
+
var match = fn && fn.toString().match(functionTypeCheckRE);
|
|
1763
1771
|
return match ? match[1] : ''
|
|
1764
1772
|
}
|
|
1765
1773
|
|
|
@@ -1784,18 +1792,19 @@
|
|
|
1784
1792
|
" Expected " + (expectedTypes.map(capitalize).join(', '));
|
|
1785
1793
|
var expectedType = expectedTypes[0];
|
|
1786
1794
|
var receivedType = toRawType(value);
|
|
1787
|
-
var expectedValue = styleValue(value, expectedType);
|
|
1788
|
-
var receivedValue = styleValue(value, receivedType);
|
|
1789
1795
|
// check if we need to specify expected value
|
|
1790
|
-
if (
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1796
|
+
if (
|
|
1797
|
+
expectedTypes.length === 1 &&
|
|
1798
|
+
isExplicable(expectedType) &&
|
|
1799
|
+
isExplicable(typeof value) &&
|
|
1800
|
+
!isBoolean(expectedType, receivedType)
|
|
1801
|
+
) {
|
|
1802
|
+
message += " with value " + (styleValue(value, expectedType));
|
|
1794
1803
|
}
|
|
1795
1804
|
message += ", got " + receivedType + " ";
|
|
1796
1805
|
// check if we need to specify received value
|
|
1797
1806
|
if (isExplicable(receivedType)) {
|
|
1798
|
-
message += "with value " +
|
|
1807
|
+
message += "with value " + (styleValue(value, receivedType)) + ".";
|
|
1799
1808
|
}
|
|
1800
1809
|
return message
|
|
1801
1810
|
}
|
|
@@ -1810,9 +1819,9 @@
|
|
|
1810
1819
|
}
|
|
1811
1820
|
}
|
|
1812
1821
|
|
|
1822
|
+
var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
|
|
1813
1823
|
function isExplicable (value) {
|
|
1814
|
-
|
|
1815
|
-
return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
|
|
1824
|
+
return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; })
|
|
1816
1825
|
}
|
|
1817
1826
|
|
|
1818
1827
|
function isBoolean () {
|
|
@@ -1969,7 +1978,7 @@
|
|
|
1969
1978
|
isUsingMicroTask = true;
|
|
1970
1979
|
} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
|
|
1971
1980
|
// Fallback to setImmediate.
|
|
1972
|
-
//
|
|
1981
|
+
// Technically it leverages the (macro) task queue,
|
|
1973
1982
|
// but it is still a better choice than setTimeout.
|
|
1974
1983
|
timerFunc = function () {
|
|
1975
1984
|
setImmediate(flushCallbacks);
|
|
@@ -2039,7 +2048,7 @@
|
|
|
2039
2048
|
var allowedGlobals = makeMap(
|
|
2040
2049
|
'Infinity,undefined,NaN,isFinite,isNaN,' +
|
|
2041
2050
|
'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
|
|
2042
|
-
'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
|
|
2051
|
+
'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
|
|
2043
2052
|
'require' // for Webpack/Browserify
|
|
2044
2053
|
);
|
|
2045
2054
|
|
|
@@ -2058,7 +2067,7 @@
|
|
|
2058
2067
|
warn(
|
|
2059
2068
|
"Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
|
|
2060
2069
|
'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
|
|
2061
|
-
'prevent conflicts with Vue internals' +
|
|
2070
|
+
'prevent conflicts with Vue internals. ' +
|
|
2062
2071
|
'See: https://vuejs.org/v2/api/#data',
|
|
2063
2072
|
target
|
|
2064
2073
|
);
|
|
@@ -2542,14 +2551,20 @@
|
|
|
2542
2551
|
|
|
2543
2552
|
/* */
|
|
2544
2553
|
|
|
2554
|
+
function isAsyncPlaceholder (node) {
|
|
2555
|
+
return node.isComment && node.asyncFactory
|
|
2556
|
+
}
|
|
2557
|
+
|
|
2558
|
+
/* */
|
|
2559
|
+
|
|
2545
2560
|
function normalizeScopedSlots (
|
|
2546
2561
|
slots,
|
|
2547
2562
|
normalSlots,
|
|
2548
2563
|
prevSlots
|
|
2549
2564
|
) {
|
|
2550
2565
|
var res;
|
|
2551
|
-
var isStable = slots ? !!slots.$stable : true;
|
|
2552
2566
|
var hasNormalSlots = Object.keys(normalSlots).length > 0;
|
|
2567
|
+
var isStable = slots ? !!slots.$stable : !hasNormalSlots;
|
|
2553
2568
|
var key = slots && slots.$key;
|
|
2554
2569
|
if (!slots) {
|
|
2555
2570
|
res = {};
|
|
@@ -2598,9 +2613,10 @@
|
|
|
2598
2613
|
res = res && typeof res === 'object' && !Array.isArray(res)
|
|
2599
2614
|
? [res] // single vnode
|
|
2600
2615
|
: normalizeChildren(res);
|
|
2616
|
+
var vnode = res && res[0];
|
|
2601
2617
|
return res && (
|
|
2602
|
-
|
|
2603
|
-
(
|
|
2618
|
+
!vnode ||
|
|
2619
|
+
(vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
|
|
2604
2620
|
) ? undefined
|
|
2605
2621
|
: res
|
|
2606
2622
|
};
|
|
@@ -2673,26 +2689,28 @@
|
|
|
2673
2689
|
*/
|
|
2674
2690
|
function renderSlot (
|
|
2675
2691
|
name,
|
|
2676
|
-
|
|
2692
|
+
fallbackRender,
|
|
2677
2693
|
props,
|
|
2678
2694
|
bindObject
|
|
2679
2695
|
) {
|
|
2680
2696
|
var scopedSlotFn = this.$scopedSlots[name];
|
|
2681
2697
|
var nodes;
|
|
2682
|
-
if (scopedSlotFn) {
|
|
2698
|
+
if (scopedSlotFn) {
|
|
2699
|
+
// scoped slot
|
|
2683
2700
|
props = props || {};
|
|
2684
2701
|
if (bindObject) {
|
|
2685
2702
|
if (!isObject(bindObject)) {
|
|
2686
|
-
warn(
|
|
2687
|
-
'slot v-bind without argument expects an Object',
|
|
2688
|
-
this
|
|
2689
|
-
);
|
|
2703
|
+
warn('slot v-bind without argument expects an Object', this);
|
|
2690
2704
|
}
|
|
2691
2705
|
props = extend(extend({}, bindObject), props);
|
|
2692
2706
|
}
|
|
2693
|
-
nodes =
|
|
2707
|
+
nodes =
|
|
2708
|
+
scopedSlotFn(props) ||
|
|
2709
|
+
(typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender);
|
|
2694
2710
|
} else {
|
|
2695
|
-
nodes =
|
|
2711
|
+
nodes =
|
|
2712
|
+
this.$slots[name] ||
|
|
2713
|
+
(typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender);
|
|
2696
2714
|
}
|
|
2697
2715
|
|
|
2698
2716
|
var target = props && props.slot;
|
|
@@ -2742,6 +2760,7 @@
|
|
|
2742
2760
|
} else if (eventKeyName) {
|
|
2743
2761
|
return hyphenate(eventKeyName) !== key
|
|
2744
2762
|
}
|
|
2763
|
+
return eventKeyCode === undefined
|
|
2745
2764
|
}
|
|
2746
2765
|
|
|
2747
2766
|
/* */
|
|
@@ -2918,7 +2937,7 @@
|
|
|
2918
2937
|
if (typeof key === 'string' && key) {
|
|
2919
2938
|
baseObj[values[i]] = values[i + 1];
|
|
2920
2939
|
} else if (key !== '' && key !== null) {
|
|
2921
|
-
// null is a
|
|
2940
|
+
// null is a special value for explicitly removing a binding
|
|
2922
2941
|
warn(
|
|
2923
2942
|
("Invalid value for dynamic directive argument (expected string or null): " + key),
|
|
2924
2943
|
this
|
|
@@ -3273,8 +3292,10 @@
|
|
|
3273
3292
|
}
|
|
3274
3293
|
|
|
3275
3294
|
function createComponentInstanceForVnode (
|
|
3276
|
-
|
|
3277
|
-
|
|
3295
|
+
// we know it's MountedComponentVNode but flow doesn't
|
|
3296
|
+
vnode,
|
|
3297
|
+
// activeInstance in lifecycle state
|
|
3298
|
+
parent
|
|
3278
3299
|
) {
|
|
3279
3300
|
var options = {
|
|
3280
3301
|
_isComponent: true,
|
|
@@ -3413,6 +3434,12 @@
|
|
|
3413
3434
|
ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
|
|
3414
3435
|
if (config.isReservedTag(tag)) {
|
|
3415
3436
|
// platform built-in elements
|
|
3437
|
+
if (isDef(data) && isDef(data.nativeOn) && data.tag !== 'component') {
|
|
3438
|
+
warn(
|
|
3439
|
+
("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
|
|
3440
|
+
context
|
|
3441
|
+
);
|
|
3442
|
+
}
|
|
3416
3443
|
vnode = new VNode(
|
|
3417
3444
|
config.parsePlatformTagName(tag), data, children,
|
|
3418
3445
|
undefined, undefined, context
|
|
@@ -3538,7 +3565,7 @@
|
|
|
3538
3565
|
// render self
|
|
3539
3566
|
var vnode;
|
|
3540
3567
|
try {
|
|
3541
|
-
// There's no need to maintain a stack
|
|
3568
|
+
// There's no need to maintain a stack because all render fns are called
|
|
3542
3569
|
// separately from one another. Nested component's render fns are called
|
|
3543
3570
|
// when parent component is patched.
|
|
3544
3571
|
currentRenderingInstance = vm;
|
|
@@ -3633,7 +3660,9 @@
|
|
|
3633
3660
|
|
|
3634
3661
|
if (owner && !isDef(factory.owners)) {
|
|
3635
3662
|
var owners = factory.owners = [owner];
|
|
3636
|
-
var sync = true
|
|
3663
|
+
var sync = true;
|
|
3664
|
+
var timerLoading = null;
|
|
3665
|
+
var timerTimeout = null
|
|
3637
3666
|
|
|
3638
3667
|
;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
|
|
3639
3668
|
|
|
@@ -3644,6 +3673,14 @@
|
|
|
3644
3673
|
|
|
3645
3674
|
if (renderCompleted) {
|
|
3646
3675
|
owners.length = 0;
|
|
3676
|
+
if (timerLoading !== null) {
|
|
3677
|
+
clearTimeout(timerLoading);
|
|
3678
|
+
timerLoading = null;
|
|
3679
|
+
}
|
|
3680
|
+
if (timerTimeout !== null) {
|
|
3681
|
+
clearTimeout(timerTimeout);
|
|
3682
|
+
timerTimeout = null;
|
|
3683
|
+
}
|
|
3647
3684
|
}
|
|
3648
3685
|
};
|
|
3649
3686
|
|
|
@@ -3690,7 +3727,8 @@
|
|
|
3690
3727
|
if (res.delay === 0) {
|
|
3691
3728
|
factory.loading = true;
|
|
3692
3729
|
} else {
|
|
3693
|
-
setTimeout(function () {
|
|
3730
|
+
timerLoading = setTimeout(function () {
|
|
3731
|
+
timerLoading = null;
|
|
3694
3732
|
if (isUndef(factory.resolved) && isUndef(factory.error)) {
|
|
3695
3733
|
factory.loading = true;
|
|
3696
3734
|
forceRender(false);
|
|
@@ -3700,7 +3738,8 @@
|
|
|
3700
3738
|
}
|
|
3701
3739
|
|
|
3702
3740
|
if (isDef(res.timeout)) {
|
|
3703
|
-
setTimeout(function () {
|
|
3741
|
+
timerTimeout = setTimeout(function () {
|
|
3742
|
+
timerTimeout = null;
|
|
3704
3743
|
if (isUndef(factory.resolved)) {
|
|
3705
3744
|
reject(
|
|
3706
3745
|
"timeout (" + (res.timeout) + "ms)"
|
|
@@ -3721,12 +3760,6 @@
|
|
|
3721
3760
|
|
|
3722
3761
|
/* */
|
|
3723
3762
|
|
|
3724
|
-
function isAsyncPlaceholder (node) {
|
|
3725
|
-
return node.isComment && node.asyncFactory
|
|
3726
|
-
}
|
|
3727
|
-
|
|
3728
|
-
/* */
|
|
3729
|
-
|
|
3730
3763
|
function getFirstComponentChild (children) {
|
|
3731
3764
|
if (Array.isArray(children)) {
|
|
3732
3765
|
for (var i = 0; i < children.length; i++) {
|
|
@@ -4093,7 +4126,8 @@
|
|
|
4093
4126
|
var hasDynamicScopedSlot = !!(
|
|
4094
4127
|
(newScopedSlots && !newScopedSlots.$stable) ||
|
|
4095
4128
|
(oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
|
|
4096
|
-
(newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
|
|
4129
|
+
(newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
|
|
4130
|
+
(!newScopedSlots && vm.$scopedSlots.$key)
|
|
4097
4131
|
);
|
|
4098
4132
|
|
|
4099
4133
|
// Any static slot children from the parent may have changed during parent's
|
|
@@ -4246,16 +4280,21 @@
|
|
|
4246
4280
|
// timestamp can either be hi-res (relative to page load) or low-res
|
|
4247
4281
|
// (relative to UNIX epoch), so in order to compare time we have to use the
|
|
4248
4282
|
// same timestamp type when saving the flush timestamp.
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4283
|
+
// All IE versions use low-res event timestamps, and have problematic clock
|
|
4284
|
+
// implementations (#9632)
|
|
4285
|
+
if (inBrowser && !isIE) {
|
|
4286
|
+
var performance = window.performance;
|
|
4287
|
+
if (
|
|
4288
|
+
performance &&
|
|
4289
|
+
typeof performance.now === 'function' &&
|
|
4290
|
+
getNow() > document.createEvent('Event').timeStamp
|
|
4291
|
+
) {
|
|
4292
|
+
// if the event timestamp, although evaluated AFTER the Date.now(), is
|
|
4293
|
+
// smaller than it, it means the event is using a hi-res timestamp,
|
|
4294
|
+
// and we need to use the hi-res version for event listener timestamps as
|
|
4295
|
+
// well.
|
|
4296
|
+
getNow = function () { return performance.now(); };
|
|
4297
|
+
}
|
|
4259
4298
|
}
|
|
4260
4299
|
|
|
4261
4300
|
/**
|
|
@@ -4540,11 +4579,8 @@
|
|
|
4540
4579
|
var oldValue = this.value;
|
|
4541
4580
|
this.value = value;
|
|
4542
4581
|
if (this.user) {
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
} catch (e) {
|
|
4546
|
-
handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
|
|
4547
|
-
}
|
|
4582
|
+
var info = "callback for watcher \"" + (this.expression) + "\"";
|
|
4583
|
+
invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info);
|
|
4548
4584
|
} else {
|
|
4549
4585
|
this.cb.call(this.vm, value, oldValue);
|
|
4550
4586
|
}
|
|
@@ -4766,6 +4802,8 @@
|
|
|
4766
4802
|
warn(("The computed property \"" + key + "\" is already defined in data."), vm);
|
|
4767
4803
|
} else if (vm.$options.props && key in vm.$options.props) {
|
|
4768
4804
|
warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
|
|
4805
|
+
} else if (vm.$options.methods && key in vm.$options.methods) {
|
|
4806
|
+
warn(("The computed property \"" + key + "\" is already defined as a method."), vm);
|
|
4769
4807
|
}
|
|
4770
4808
|
}
|
|
4771
4809
|
}
|
|
@@ -4918,11 +4956,10 @@
|
|
|
4918
4956
|
options.user = true;
|
|
4919
4957
|
var watcher = new Watcher(vm, expOrFn, cb, options);
|
|
4920
4958
|
if (options.immediate) {
|
|
4921
|
-
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
}
|
|
4959
|
+
var info = "callback for immediate watcher \"" + (watcher.expression) + "\"";
|
|
4960
|
+
pushTarget();
|
|
4961
|
+
invokeWithErrorHandling(cb, vm, [watcher.value], vm, info);
|
|
4962
|
+
popTarget();
|
|
4926
4963
|
}
|
|
4927
4964
|
return function unwatchFn () {
|
|
4928
4965
|
watcher.teardown();
|
|
@@ -5220,6 +5257,8 @@
|
|
|
5220
5257
|
|
|
5221
5258
|
|
|
5222
5259
|
|
|
5260
|
+
|
|
5261
|
+
|
|
5223
5262
|
function getComponentName (opts) {
|
|
5224
5263
|
return opts && (opts.Ctor.options.name || opts.tag)
|
|
5225
5264
|
}
|
|
@@ -5241,9 +5280,9 @@
|
|
|
5241
5280
|
var keys = keepAliveInstance.keys;
|
|
5242
5281
|
var _vnode = keepAliveInstance._vnode;
|
|
5243
5282
|
for (var key in cache) {
|
|
5244
|
-
var
|
|
5245
|
-
if (
|
|
5246
|
-
var name =
|
|
5283
|
+
var entry = cache[key];
|
|
5284
|
+
if (entry) {
|
|
5285
|
+
var name = entry.name;
|
|
5247
5286
|
if (name && !filter(name)) {
|
|
5248
5287
|
pruneCacheEntry(cache, key, keys, _vnode);
|
|
5249
5288
|
}
|
|
@@ -5257,9 +5296,9 @@
|
|
|
5257
5296
|
keys,
|
|
5258
5297
|
current
|
|
5259
5298
|
) {
|
|
5260
|
-
var
|
|
5261
|
-
if (
|
|
5262
|
-
|
|
5299
|
+
var entry = cache[key];
|
|
5300
|
+
if (entry && (!current || entry.tag !== current.tag)) {
|
|
5301
|
+
entry.componentInstance.$destroy();
|
|
5263
5302
|
}
|
|
5264
5303
|
cache[key] = null;
|
|
5265
5304
|
remove(keys, key);
|
|
@@ -5277,6 +5316,32 @@
|
|
|
5277
5316
|
max: [String, Number]
|
|
5278
5317
|
},
|
|
5279
5318
|
|
|
5319
|
+
methods: {
|
|
5320
|
+
cacheVNode: function cacheVNode() {
|
|
5321
|
+
var ref = this;
|
|
5322
|
+
var cache = ref.cache;
|
|
5323
|
+
var keys = ref.keys;
|
|
5324
|
+
var vnodeToCache = ref.vnodeToCache;
|
|
5325
|
+
var keyToCache = ref.keyToCache;
|
|
5326
|
+
if (vnodeToCache) {
|
|
5327
|
+
var tag = vnodeToCache.tag;
|
|
5328
|
+
var componentInstance = vnodeToCache.componentInstance;
|
|
5329
|
+
var componentOptions = vnodeToCache.componentOptions;
|
|
5330
|
+
cache[keyToCache] = {
|
|
5331
|
+
name: getComponentName(componentOptions),
|
|
5332
|
+
tag: tag,
|
|
5333
|
+
componentInstance: componentInstance,
|
|
5334
|
+
};
|
|
5335
|
+
keys.push(keyToCache);
|
|
5336
|
+
// prune oldest entry
|
|
5337
|
+
if (this.max && keys.length > parseInt(this.max)) {
|
|
5338
|
+
pruneCacheEntry(cache, keys[0], keys, this._vnode);
|
|
5339
|
+
}
|
|
5340
|
+
this.vnodeToCache = null;
|
|
5341
|
+
}
|
|
5342
|
+
}
|
|
5343
|
+
},
|
|
5344
|
+
|
|
5280
5345
|
created: function created () {
|
|
5281
5346
|
this.cache = Object.create(null);
|
|
5282
5347
|
this.keys = [];
|
|
@@ -5291,6 +5356,7 @@
|
|
|
5291
5356
|
mounted: function mounted () {
|
|
5292
5357
|
var this$1 = this;
|
|
5293
5358
|
|
|
5359
|
+
this.cacheVNode();
|
|
5294
5360
|
this.$watch('include', function (val) {
|
|
5295
5361
|
pruneCache(this$1, function (name) { return matches(val, name); });
|
|
5296
5362
|
});
|
|
@@ -5299,6 +5365,10 @@
|
|
|
5299
5365
|
});
|
|
5300
5366
|
},
|
|
5301
5367
|
|
|
5368
|
+
updated: function updated () {
|
|
5369
|
+
this.cacheVNode();
|
|
5370
|
+
},
|
|
5371
|
+
|
|
5302
5372
|
render: function render () {
|
|
5303
5373
|
var slot = this.$slots.default;
|
|
5304
5374
|
var vnode = getFirstComponentChild(slot);
|
|
@@ -5332,12 +5402,9 @@
|
|
|
5332
5402
|
remove(keys, key);
|
|
5333
5403
|
keys.push(key);
|
|
5334
5404
|
} else {
|
|
5335
|
-
cache
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
if (this.max && keys.length > parseInt(this.max)) {
|
|
5339
|
-
pruneCacheEntry(cache, keys[0], keys, this._vnode);
|
|
5340
|
-
}
|
|
5405
|
+
// delay setting the cache until update
|
|
5406
|
+
this.vnodeToCache = vnode;
|
|
5407
|
+
this.keyToCache = key;
|
|
5341
5408
|
}
|
|
5342
5409
|
|
|
5343
5410
|
vnode.data.keepAlive = true;
|
|
@@ -5420,7 +5487,7 @@
|
|
|
5420
5487
|
value: FunctionalRenderContext
|
|
5421
5488
|
});
|
|
5422
5489
|
|
|
5423
|
-
Vue.version = '2.6.
|
|
5490
|
+
Vue.version = '2.6.13';
|
|
5424
5491
|
|
|
5425
5492
|
/* */
|
|
5426
5493
|
|
|
@@ -5457,7 +5524,7 @@
|
|
|
5457
5524
|
'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
|
|
5458
5525
|
'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
|
|
5459
5526
|
'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
|
|
5460
|
-
'required,reversed,scoped,seamless,selected,sortable,
|
|
5527
|
+
'required,reversed,scoped,seamless,selected,sortable,' +
|
|
5461
5528
|
'truespeed,typemustmatch,visible'
|
|
5462
5529
|
);
|
|
5463
5530
|
|
|
@@ -5581,7 +5648,7 @@
|
|
|
5581
5648
|
// contain child elements.
|
|
5582
5649
|
var isSVG = makeMap(
|
|
5583
5650
|
'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
|
|
5584
|
-
'
|
|
5651
|
+
'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
|
|
5585
5652
|
'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
|
|
5586
5653
|
true
|
|
5587
5654
|
);
|
|
@@ -5786,7 +5853,8 @@
|
|
|
5786
5853
|
|
|
5787
5854
|
function sameVnode (a, b) {
|
|
5788
5855
|
return (
|
|
5789
|
-
a.key === b.key &&
|
|
5856
|
+
a.key === b.key &&
|
|
5857
|
+
a.asyncFactory === b.asyncFactory && (
|
|
5790
5858
|
(
|
|
5791
5859
|
a.tag === b.tag &&
|
|
5792
5860
|
a.isComment === b.isComment &&
|
|
@@ -5794,7 +5862,6 @@
|
|
|
5794
5862
|
sameInputType(a, b)
|
|
5795
5863
|
) || (
|
|
5796
5864
|
isTrue(a.isAsyncPlaceholder) &&
|
|
5797
|
-
a.asyncFactory === b.asyncFactory &&
|
|
5798
5865
|
isUndef(b.asyncFactory.error)
|
|
5799
5866
|
)
|
|
5800
5867
|
)
|
|
@@ -6093,7 +6160,7 @@
|
|
|
6093
6160
|
}
|
|
6094
6161
|
}
|
|
6095
6162
|
|
|
6096
|
-
function removeVnodes (
|
|
6163
|
+
function removeVnodes (vnodes, startIdx, endIdx) {
|
|
6097
6164
|
for (; startIdx <= endIdx; ++startIdx) {
|
|
6098
6165
|
var ch = vnodes[startIdx];
|
|
6099
6166
|
if (isDef(ch)) {
|
|
@@ -6204,7 +6271,7 @@
|
|
|
6204
6271
|
refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
|
|
6205
6272
|
addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
|
|
6206
6273
|
} else if (newStartIdx > newEndIdx) {
|
|
6207
|
-
removeVnodes(
|
|
6274
|
+
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
6208
6275
|
}
|
|
6209
6276
|
}
|
|
6210
6277
|
|
|
@@ -6296,7 +6363,7 @@
|
|
|
6296
6363
|
if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
|
|
6297
6364
|
addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
|
|
6298
6365
|
} else if (isDef(oldCh)) {
|
|
6299
|
-
removeVnodes(
|
|
6366
|
+
removeVnodes(oldCh, 0, oldCh.length - 1);
|
|
6300
6367
|
} else if (isDef(oldVnode.text)) {
|
|
6301
6368
|
nodeOps.setTextContent(elm, '');
|
|
6302
6369
|
}
|
|
@@ -6525,7 +6592,7 @@
|
|
|
6525
6592
|
|
|
6526
6593
|
// destroy old node
|
|
6527
6594
|
if (isDef(parentElm)) {
|
|
6528
|
-
removeVnodes(
|
|
6595
|
+
removeVnodes([oldVnode], 0, 0);
|
|
6529
6596
|
} else if (isDef(oldVnode.tag)) {
|
|
6530
6597
|
invokeDestroyHook(oldVnode);
|
|
6531
6598
|
}
|
|
@@ -6682,7 +6749,7 @@
|
|
|
6682
6749
|
cur = attrs[key];
|
|
6683
6750
|
old = oldAttrs[key];
|
|
6684
6751
|
if (old !== cur) {
|
|
6685
|
-
setAttr(elm, key, cur);
|
|
6752
|
+
setAttr(elm, key, cur, vnode.data.pre);
|
|
6686
6753
|
}
|
|
6687
6754
|
}
|
|
6688
6755
|
// #4391: in IE9, setting type can reset value for input[type=radio]
|
|
@@ -6702,8 +6769,8 @@
|
|
|
6702
6769
|
}
|
|
6703
6770
|
}
|
|
6704
6771
|
|
|
6705
|
-
function setAttr (el, key, value) {
|
|
6706
|
-
if (el.tagName.indexOf('-') > -1) {
|
|
6772
|
+
function setAttr (el, key, value, isInPre) {
|
|
6773
|
+
if (isInPre || el.tagName.indexOf('-') > -1) {
|
|
6707
6774
|
baseSetAttr(el, key, value);
|
|
6708
6775
|
} else if (isBooleanAttr(key)) {
|
|
6709
6776
|
// set attribute for blank value
|
|
@@ -7582,10 +7649,11 @@
|
|
|
7582
7649
|
}
|
|
7583
7650
|
|
|
7584
7651
|
for (key in oldProps) {
|
|
7585
|
-
if (
|
|
7652
|
+
if (!(key in props)) {
|
|
7586
7653
|
elm[key] = '';
|
|
7587
7654
|
}
|
|
7588
7655
|
}
|
|
7656
|
+
|
|
7589
7657
|
for (key in props) {
|
|
7590
7658
|
cur = props[key];
|
|
7591
7659
|
// ignore children if the node has textContent or innerHTML,
|
|
@@ -7625,7 +7693,7 @@
|
|
|
7625
7693
|
// skip the update if old and new VDOM state is the same.
|
|
7626
7694
|
// `value` is handled separately because the DOM value may be temporarily
|
|
7627
7695
|
// out of sync with VDOM state due to focus, composition and modifiers.
|
|
7628
|
-
// This #4521 by skipping the
|
|
7696
|
+
// This #4521 by skipping the unnecessary `checked` update.
|
|
7629
7697
|
cur !== oldProps[key]
|
|
7630
7698
|
) {
|
|
7631
7699
|
// some property updates can throw
|
|
@@ -9223,14 +9291,14 @@
|
|
|
9223
9291
|
|
|
9224
9292
|
// Regular Expressions for parsing tags and attributes
|
|
9225
9293
|
var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
|
|
9226
|
-
var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]
|
|
9294
|
+
var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
|
|
9227
9295
|
var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
|
|
9228
9296
|
var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
|
|
9229
9297
|
var startTagOpen = new RegExp(("^<" + qnameCapture));
|
|
9230
9298
|
var startTagClose = /^\s*(\/?)>/;
|
|
9231
9299
|
var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
|
|
9232
9300
|
var doctype = /^<!DOCTYPE [^>]+>/i;
|
|
9233
|
-
// #7298: escape - to avoid being
|
|
9301
|
+
// #7298: escape - to avoid being passed as HTML comment when inlined in page
|
|
9234
9302
|
var comment = /^<!\--/;
|
|
9235
9303
|
var conditionalComment = /^<!\[/;
|
|
9236
9304
|
|
|
@@ -9515,7 +9583,7 @@
|
|
|
9515
9583
|
/* */
|
|
9516
9584
|
|
|
9517
9585
|
var onRE = /^@|^v-on:/;
|
|
9518
|
-
var dirRE = /^v
|
|
9586
|
+
var dirRE = /^v-|^@|^:|^#/;
|
|
9519
9587
|
var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
|
|
9520
9588
|
var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
|
|
9521
9589
|
var stripParensRE = /^\(|\)$/g;
|
|
@@ -9528,7 +9596,7 @@
|
|
|
9528
9596
|
var slotRE = /^v-slot(:|$)|^#/;
|
|
9529
9597
|
|
|
9530
9598
|
var lineBreakRE = /[\r\n]/;
|
|
9531
|
-
var whitespaceRE$1 =
|
|
9599
|
+
var whitespaceRE$1 = /[ \f\t\r\n]+/g;
|
|
9532
9600
|
|
|
9533
9601
|
var invalidAttributeRE = /[\s"'<>\/=]/;
|
|
9534
9602
|
|
|
@@ -9576,8 +9644,12 @@
|
|
|
9576
9644
|
platformMustUseProp = options.mustUseProp || no;
|
|
9577
9645
|
platformGetTagNamespace = options.getTagNamespace || no;
|
|
9578
9646
|
var isReservedTag = options.isReservedTag || no;
|
|
9579
|
-
maybeComponent = function (el) { return !!
|
|
9580
|
-
|
|
9647
|
+
maybeComponent = function (el) { return !!(
|
|
9648
|
+
el.component ||
|
|
9649
|
+
el.attrsMap[':is'] ||
|
|
9650
|
+
el.attrsMap['v-bind:is'] ||
|
|
9651
|
+
!(el.attrsMap.is ? isReservedTag(el.attrsMap.is) : isReservedTag(el.tag))
|
|
9652
|
+
); };
|
|
9581
9653
|
transforms = pluckModuleFunction(options.modules, 'transformNode');
|
|
9582
9654
|
preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
|
|
9583
9655
|
postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
|
|
@@ -9870,7 +9942,7 @@
|
|
|
9870
9942
|
}
|
|
9871
9943
|
},
|
|
9872
9944
|
comment: function comment (text, start, end) {
|
|
9873
|
-
// adding
|
|
9945
|
+
// adding anything as a sibling to the root node is forbidden
|
|
9874
9946
|
// comments should still be allowed, but ignored
|
|
9875
9947
|
if (currentParent) {
|
|
9876
9948
|
var child = {
|
|
@@ -10139,7 +10211,7 @@
|
|
|
10139
10211
|
if (el.parent && !maybeComponent(el.parent)) {
|
|
10140
10212
|
warn$2(
|
|
10141
10213
|
"<template v-slot> can only appear at the root level inside " +
|
|
10142
|
-
"the receiving
|
|
10214
|
+
"the receiving component",
|
|
10143
10215
|
el
|
|
10144
10216
|
);
|
|
10145
10217
|
}
|
|
@@ -10702,7 +10774,7 @@
|
|
|
10702
10774
|
|
|
10703
10775
|
/* */
|
|
10704
10776
|
|
|
10705
|
-
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
|
|
10777
|
+
var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
|
|
10706
10778
|
var fnInvokeRE = /\([^)]*?\);*$/;
|
|
10707
10779
|
var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
|
|
10708
10780
|
|
|
@@ -10826,9 +10898,9 @@
|
|
|
10826
10898
|
code += genModifierCode;
|
|
10827
10899
|
}
|
|
10828
10900
|
var handlerCode = isMethodPath
|
|
10829
|
-
? ("return " + (handler.value) + "(
|
|
10901
|
+
? ("return " + (handler.value) + ".apply(null, arguments)")
|
|
10830
10902
|
: isFunctionExpression
|
|
10831
|
-
? ("return (" + (handler.value) + ")(
|
|
10903
|
+
? ("return (" + (handler.value) + ").apply(null, arguments)")
|
|
10832
10904
|
: isFunctionInvocation
|
|
10833
10905
|
? ("return " + (handler.value))
|
|
10834
10906
|
: handler.value;
|
|
@@ -10914,7 +10986,8 @@
|
|
|
10914
10986
|
options
|
|
10915
10987
|
) {
|
|
10916
10988
|
var state = new CodegenState(options);
|
|
10917
|
-
|
|
10989
|
+
// fix #11483, Root level <script> tags should not be rendered.
|
|
10990
|
+
var code = ast ? (ast.tag === 'script' ? 'null' : genElement(ast, state)) : '_c("div")';
|
|
10918
10991
|
return {
|
|
10919
10992
|
render: ("with(this){return " + code + "}"),
|
|
10920
10993
|
staticRenderFns: state.staticRenderFns
|
|
@@ -11376,7 +11449,7 @@
|
|
|
11376
11449
|
function genSlot (el, state) {
|
|
11377
11450
|
var slotName = el.slotName || '"default"';
|
|
11378
11451
|
var children = genChildren(el, state);
|
|
11379
|
-
var res = "_t(" + slotName + (children ? ("," + children) : '');
|
|
11452
|
+
var res = "_t(" + slotName + (children ? (",function(){return " + children + "}") : '');
|
|
11380
11453
|
var attrs = el.attrs || el.dynamicAttrs
|
|
11381
11454
|
? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
|
|
11382
11455
|
// slot props are camelized
|
|
@@ -11471,6 +11544,8 @@
|
|
|
11471
11544
|
var range = node.rawAttrsMap[name];
|
|
11472
11545
|
if (name === 'v-for') {
|
|
11473
11546
|
checkFor(node, ("v-for=\"" + value + "\""), warn, range);
|
|
11547
|
+
} else if (name === 'v-slot' || name[0] === '#') {
|
|
11548
|
+
checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
|
|
11474
11549
|
} else if (onRE.test(name)) {
|
|
11475
11550
|
checkEvent(value, (name + "=\"" + value + "\""), warn, range);
|
|
11476
11551
|
} else {
|
|
@@ -11490,9 +11565,9 @@
|
|
|
11490
11565
|
}
|
|
11491
11566
|
|
|
11492
11567
|
function checkEvent (exp, text, warn, range) {
|
|
11493
|
-
var
|
|
11494
|
-
var keywordMatch =
|
|
11495
|
-
if (keywordMatch &&
|
|
11568
|
+
var stripped = exp.replace(stripStringRE, '');
|
|
11569
|
+
var keywordMatch = stripped.match(unaryOperatorsRE);
|
|
11570
|
+
if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
|
|
11496
11571
|
warn(
|
|
11497
11572
|
"avoid using JavaScript unary operator as property name: " +
|
|
11498
11573
|
"\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
|
|
@@ -11547,6 +11622,19 @@
|
|
|
11547
11622
|
}
|
|
11548
11623
|
}
|
|
11549
11624
|
|
|
11625
|
+
function checkFunctionParameterExpression (exp, text, warn, range) {
|
|
11626
|
+
try {
|
|
11627
|
+
new Function(exp, '');
|
|
11628
|
+
} catch (e) {
|
|
11629
|
+
warn(
|
|
11630
|
+
"invalid function parameter expression: " + (e.message) + " in\n\n" +
|
|
11631
|
+
" " + exp + "\n\n" +
|
|
11632
|
+
" Raw expression: " + (text.trim()) + "\n",
|
|
11633
|
+
range
|
|
11634
|
+
);
|
|
11635
|
+
}
|
|
11636
|
+
}
|
|
11637
|
+
|
|
11550
11638
|
/* */
|
|
11551
11639
|
|
|
11552
11640
|
var range = 2;
|