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.
Files changed (57) hide show
  1. package/README.md +133 -74
  2. package/dist/README.md +2 -4
  3. package/dist/vue.common.dev.js +195 -107
  4. package/dist/vue.common.prod.js +3 -3
  5. package/dist/vue.esm.browser.js +189 -107
  6. package/dist/vue.esm.browser.min.js +3 -3
  7. package/dist/vue.esm.js +195 -107
  8. package/dist/vue.js +195 -107
  9. package/dist/vue.min.js +3 -3
  10. package/dist/vue.runtime.common.dev.js +159 -91
  11. package/dist/vue.runtime.common.prod.js +3 -3
  12. package/dist/vue.runtime.esm.js +159 -91
  13. package/dist/vue.runtime.js +159 -91
  14. package/dist/vue.runtime.min.js +3 -3
  15. package/package.json +5 -5
  16. package/src/compiler/codegen/events.js +3 -3
  17. package/src/compiler/codegen/index.js +3 -2
  18. package/src/compiler/error-detector.js +18 -3
  19. package/src/compiler/parser/html-parser.js +3 -3
  20. package/src/compiler/parser/index.js +11 -7
  21. package/src/core/components/keep-alive.js +42 -14
  22. package/src/core/instance/lifecycle.js +2 -1
  23. package/src/core/instance/proxy.js +2 -2
  24. package/src/core/instance/render-helpers/bind-dynamic-keys.js +2 -2
  25. package/src/core/instance/render-helpers/check-keycodes.js +1 -0
  26. package/src/core/instance/render-helpers/render-slot.js +10 -8
  27. package/src/core/instance/render.js +1 -1
  28. package/src/core/instance/state.js +8 -6
  29. package/src/core/observer/scheduler.js +17 -11
  30. package/src/core/observer/watcher.js +3 -5
  31. package/src/core/util/env.js +1 -2
  32. package/src/core/util/next-tick.js +1 -1
  33. package/src/core/util/props.js +24 -15
  34. package/src/core/vdom/create-component.js +4 -2
  35. package/src/core/vdom/create-element.js +6 -0
  36. package/src/core/vdom/helpers/normalize-scoped-slots.js +5 -3
  37. package/src/core/vdom/helpers/resolve-async-component.js +14 -2
  38. package/src/core/vdom/patch.js +6 -6
  39. package/src/platforms/web/compiler/modules/model.js +1 -1
  40. package/src/platforms/web/runtime/modules/attrs.js +3 -3
  41. package/src/platforms/web/runtime/modules/dom-props.js +3 -2
  42. package/src/platforms/web/server/modules/attrs.js +4 -0
  43. package/src/platforms/web/server/modules/dom-props.js +2 -2
  44. package/src/platforms/web/server/util.js +4 -4
  45. package/src/platforms/web/util/attrs.js +1 -1
  46. package/src/platforms/web/util/element.js +1 -1
  47. package/src/server/template-renderer/create-async-file-mapper.js +5 -1
  48. package/types/index.d.ts +1 -2
  49. package/types/options.d.ts +3 -3
  50. package/types/umd.d.ts +48 -0
  51. package/types/vnode.d.ts +3 -3
  52. package/types/vue.d.ts +5 -1
  53. package/src/.DS_Store +0 -0
  54. package/src/compiler/.DS_Store +0 -0
  55. package/src/platforms/.DS_Store +0 -0
  56. package/src/platforms/weex/.DS_Store +0 -0
  57. package/src/platforms/weex/compiler/.DS_Store +0 -0
@@ -1,6 +1,6 @@
1
1
  /*!
2
- * Vue.js v2.6.9
3
- * (c) 2014-2019 Evan You
2
+ * Vue.js v2.6.13
3
+ * (c) 2014-2021 Evan You
4
4
  * Released under the MIT License.
5
5
  */
6
6
  'use strict';
@@ -1700,13 +1700,14 @@ function assertProp (
1700
1700
  type = [type];
1701
1701
  }
1702
1702
  for (var i = 0; i < type.length && !valid; i++) {
1703
- var assertedType = assertType(value, type[i]);
1703
+ var assertedType = assertType(value, type[i], vm);
1704
1704
  expectedTypes.push(assertedType.expectedType || '');
1705
1705
  valid = assertedType.valid;
1706
1706
  }
1707
1707
  }
1708
1708
 
1709
- if (!valid) {
1709
+ var haveExpectedTypes = expectedTypes.some(function (t) { return t; });
1710
+ if (!valid && haveExpectedTypes) {
1710
1711
  warn(
1711
1712
  getInvalidTypeMessage(name, value, expectedTypes),
1712
1713
  vm
@@ -1724,9 +1725,9 @@ function assertProp (
1724
1725
  }
1725
1726
  }
1726
1727
 
1727
- var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol)$/;
1728
+ var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/;
1728
1729
 
1729
- function assertType (value, type) {
1730
+ function assertType (value, type, vm) {
1730
1731
  var valid;
1731
1732
  var expectedType = getType(type);
1732
1733
  if (simpleCheckRE.test(expectedType)) {
@@ -1741,7 +1742,12 @@ function assertType (value, type) {
1741
1742
  } else if (expectedType === 'Array') {
1742
1743
  valid = Array.isArray(value);
1743
1744
  } else {
1744
- valid = value instanceof type;
1745
+ try {
1746
+ valid = value instanceof type;
1747
+ } catch (e) {
1748
+ warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm);
1749
+ valid = false;
1750
+ }
1745
1751
  }
1746
1752
  return {
1747
1753
  valid: valid,
@@ -1749,13 +1755,15 @@ function assertType (value, type) {
1749
1755
  }
1750
1756
  }
1751
1757
 
1758
+ var functionTypeCheckRE = /^\s*function (\w+)/;
1759
+
1752
1760
  /**
1753
1761
  * Use function string name to check built-in types,
1754
1762
  * because a simple equality check will fail when running
1755
1763
  * across different vms / iframes.
1756
1764
  */
1757
1765
  function getType (fn) {
1758
- var match = fn && fn.toString().match(/^\s*function (\w+)/);
1766
+ var match = fn && fn.toString().match(functionTypeCheckRE);
1759
1767
  return match ? match[1] : ''
1760
1768
  }
1761
1769
 
@@ -1780,18 +1788,19 @@ function getInvalidTypeMessage (name, value, expectedTypes) {
1780
1788
  " Expected " + (expectedTypes.map(capitalize).join(', '));
1781
1789
  var expectedType = expectedTypes[0];
1782
1790
  var receivedType = toRawType(value);
1783
- var expectedValue = styleValue(value, expectedType);
1784
- var receivedValue = styleValue(value, receivedType);
1785
1791
  // check if we need to specify expected value
1786
- if (expectedTypes.length === 1 &&
1787
- isExplicable(expectedType) &&
1788
- !isBoolean(expectedType, receivedType)) {
1789
- message += " with value " + expectedValue;
1792
+ if (
1793
+ expectedTypes.length === 1 &&
1794
+ isExplicable(expectedType) &&
1795
+ isExplicable(typeof value) &&
1796
+ !isBoolean(expectedType, receivedType)
1797
+ ) {
1798
+ message += " with value " + (styleValue(value, expectedType));
1790
1799
  }
1791
1800
  message += ", got " + receivedType + " ";
1792
1801
  // check if we need to specify received value
1793
1802
  if (isExplicable(receivedType)) {
1794
- message += "with value " + receivedValue + ".";
1803
+ message += "with value " + (styleValue(value, receivedType)) + ".";
1795
1804
  }
1796
1805
  return message
1797
1806
  }
@@ -1806,9 +1815,9 @@ function styleValue (value, type) {
1806
1815
  }
1807
1816
  }
1808
1817
 
1818
+ var EXPLICABLE_TYPES = ['string', 'number', 'boolean'];
1809
1819
  function isExplicable (value) {
1810
- var explicitTypes = ['string', 'number', 'boolean'];
1811
- return explicitTypes.some(function (elem) { return value.toLowerCase() === elem; })
1820
+ return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; })
1812
1821
  }
1813
1822
 
1814
1823
  function isBoolean () {
@@ -1965,7 +1974,7 @@ if (typeof Promise !== 'undefined' && isNative(Promise)) {
1965
1974
  isUsingMicroTask = true;
1966
1975
  } else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) {
1967
1976
  // Fallback to setImmediate.
1968
- // Techinically it leverages the (macro) task queue,
1977
+ // Technically it leverages the (macro) task queue,
1969
1978
  // but it is still a better choice than setTimeout.
1970
1979
  timerFunc = function () {
1971
1980
  setImmediate(flushCallbacks);
@@ -2035,7 +2044,7 @@ var initProxy;
2035
2044
  var allowedGlobals = makeMap(
2036
2045
  'Infinity,undefined,NaN,isFinite,isNaN,' +
2037
2046
  'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' +
2038
- 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,' +
2047
+ 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' +
2039
2048
  'require' // for Webpack/Browserify
2040
2049
  );
2041
2050
 
@@ -2054,7 +2063,7 @@ var initProxy;
2054
2063
  warn(
2055
2064
  "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " +
2056
2065
  'properties starting with "$" or "_" are not proxied in the Vue instance to ' +
2057
- 'prevent conflicts with Vue internals' +
2066
+ 'prevent conflicts with Vue internals. ' +
2058
2067
  'See: https://vuejs.org/v2/api/#data',
2059
2068
  target
2060
2069
  );
@@ -2538,14 +2547,20 @@ function isWhitespace (node) {
2538
2547
 
2539
2548
  /* */
2540
2549
 
2550
+ function isAsyncPlaceholder (node) {
2551
+ return node.isComment && node.asyncFactory
2552
+ }
2553
+
2554
+ /* */
2555
+
2541
2556
  function normalizeScopedSlots (
2542
2557
  slots,
2543
2558
  normalSlots,
2544
2559
  prevSlots
2545
2560
  ) {
2546
2561
  var res;
2547
- var isStable = slots ? !!slots.$stable : true;
2548
2562
  var hasNormalSlots = Object.keys(normalSlots).length > 0;
2563
+ var isStable = slots ? !!slots.$stable : !hasNormalSlots;
2549
2564
  var key = slots && slots.$key;
2550
2565
  if (!slots) {
2551
2566
  res = {};
@@ -2594,9 +2609,10 @@ function normalizeScopedSlot(normalSlots, key, fn) {
2594
2609
  res = res && typeof res === 'object' && !Array.isArray(res)
2595
2610
  ? [res] // single vnode
2596
2611
  : normalizeChildren(res);
2612
+ var vnode = res && res[0];
2597
2613
  return res && (
2598
- res.length === 0 ||
2599
- (res.length === 1 && res[0].isComment) // #9658
2614
+ !vnode ||
2615
+ (vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391
2600
2616
  ) ? undefined
2601
2617
  : res
2602
2618
  };
@@ -2669,26 +2685,28 @@ function renderList (
2669
2685
  */
2670
2686
  function renderSlot (
2671
2687
  name,
2672
- fallback,
2688
+ fallbackRender,
2673
2689
  props,
2674
2690
  bindObject
2675
2691
  ) {
2676
2692
  var scopedSlotFn = this.$scopedSlots[name];
2677
2693
  var nodes;
2678
- if (scopedSlotFn) { // scoped slot
2694
+ if (scopedSlotFn) {
2695
+ // scoped slot
2679
2696
  props = props || {};
2680
2697
  if (bindObject) {
2681
2698
  if (!isObject(bindObject)) {
2682
- warn(
2683
- 'slot v-bind without argument expects an Object',
2684
- this
2685
- );
2699
+ warn('slot v-bind without argument expects an Object', this);
2686
2700
  }
2687
2701
  props = extend(extend({}, bindObject), props);
2688
2702
  }
2689
- nodes = scopedSlotFn(props) || fallback;
2703
+ nodes =
2704
+ scopedSlotFn(props) ||
2705
+ (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender);
2690
2706
  } else {
2691
- nodes = this.$slots[name] || fallback;
2707
+ nodes =
2708
+ this.$slots[name] ||
2709
+ (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender);
2692
2710
  }
2693
2711
 
2694
2712
  var target = props && props.slot;
@@ -2738,6 +2756,7 @@ function checkKeyCodes (
2738
2756
  } else if (eventKeyName) {
2739
2757
  return hyphenate(eventKeyName) !== key
2740
2758
  }
2759
+ return eventKeyCode === undefined
2741
2760
  }
2742
2761
 
2743
2762
  /* */
@@ -2914,7 +2933,7 @@ function bindDynamicKeys (baseObj, values) {
2914
2933
  if (typeof key === 'string' && key) {
2915
2934
  baseObj[values[i]] = values[i + 1];
2916
2935
  } else if (key !== '' && key !== null) {
2917
- // null is a speical value for explicitly removing a binding
2936
+ // null is a special value for explicitly removing a binding
2918
2937
  warn(
2919
2938
  ("Invalid value for dynamic directive argument (expected string or null): " + key),
2920
2939
  this
@@ -3269,8 +3288,10 @@ function createComponent (
3269
3288
  }
3270
3289
 
3271
3290
  function createComponentInstanceForVnode (
3272
- vnode, // we know it's MountedComponentVNode but flow doesn't
3273
- parent // activeInstance in lifecycle state
3291
+ // we know it's MountedComponentVNode but flow doesn't
3292
+ vnode,
3293
+ // activeInstance in lifecycle state
3294
+ parent
3274
3295
  ) {
3275
3296
  var options = {
3276
3297
  _isComponent: true,
@@ -3409,6 +3430,12 @@ function _createElement (
3409
3430
  ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag);
3410
3431
  if (config.isReservedTag(tag)) {
3411
3432
  // platform built-in elements
3433
+ if (isDef(data) && isDef(data.nativeOn) && data.tag !== 'component') {
3434
+ warn(
3435
+ ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."),
3436
+ context
3437
+ );
3438
+ }
3412
3439
  vnode = new VNode(
3413
3440
  config.parsePlatformTagName(tag), data, children,
3414
3441
  undefined, undefined, context
@@ -3534,7 +3561,7 @@ function renderMixin (Vue) {
3534
3561
  // render self
3535
3562
  var vnode;
3536
3563
  try {
3537
- // There's no need to maintain a stack becaues all render fns are called
3564
+ // There's no need to maintain a stack because all render fns are called
3538
3565
  // separately from one another. Nested component's render fns are called
3539
3566
  // when parent component is patched.
3540
3567
  currentRenderingInstance = vm;
@@ -3629,7 +3656,9 @@ function resolveAsyncComponent (
3629
3656
 
3630
3657
  if (owner && !isDef(factory.owners)) {
3631
3658
  var owners = factory.owners = [owner];
3632
- var sync = true
3659
+ var sync = true;
3660
+ var timerLoading = null;
3661
+ var timerTimeout = null
3633
3662
 
3634
3663
  ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); });
3635
3664
 
@@ -3640,6 +3669,14 @@ function resolveAsyncComponent (
3640
3669
 
3641
3670
  if (renderCompleted) {
3642
3671
  owners.length = 0;
3672
+ if (timerLoading !== null) {
3673
+ clearTimeout(timerLoading);
3674
+ timerLoading = null;
3675
+ }
3676
+ if (timerTimeout !== null) {
3677
+ clearTimeout(timerTimeout);
3678
+ timerTimeout = null;
3679
+ }
3643
3680
  }
3644
3681
  };
3645
3682
 
@@ -3686,7 +3723,8 @@ function resolveAsyncComponent (
3686
3723
  if (res.delay === 0) {
3687
3724
  factory.loading = true;
3688
3725
  } else {
3689
- setTimeout(function () {
3726
+ timerLoading = setTimeout(function () {
3727
+ timerLoading = null;
3690
3728
  if (isUndef(factory.resolved) && isUndef(factory.error)) {
3691
3729
  factory.loading = true;
3692
3730
  forceRender(false);
@@ -3696,7 +3734,8 @@ function resolveAsyncComponent (
3696
3734
  }
3697
3735
 
3698
3736
  if (isDef(res.timeout)) {
3699
- setTimeout(function () {
3737
+ timerTimeout = setTimeout(function () {
3738
+ timerTimeout = null;
3700
3739
  if (isUndef(factory.resolved)) {
3701
3740
  reject(
3702
3741
  "timeout (" + (res.timeout) + "ms)"
@@ -3717,12 +3756,6 @@ function resolveAsyncComponent (
3717
3756
 
3718
3757
  /* */
3719
3758
 
3720
- function isAsyncPlaceholder (node) {
3721
- return node.isComment && node.asyncFactory
3722
- }
3723
-
3724
- /* */
3725
-
3726
3759
  function getFirstComponentChild (children) {
3727
3760
  if (Array.isArray(children)) {
3728
3761
  for (var i = 0; i < children.length; i++) {
@@ -4089,7 +4122,8 @@ function updateChildComponent (
4089
4122
  var hasDynamicScopedSlot = !!(
4090
4123
  (newScopedSlots && !newScopedSlots.$stable) ||
4091
4124
  (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) ||
4092
- (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key)
4125
+ (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) ||
4126
+ (!newScopedSlots && vm.$scopedSlots.$key)
4093
4127
  );
4094
4128
 
4095
4129
  // Any static slot children from the parent may have changed during parent's
@@ -4242,16 +4276,21 @@ var getNow = Date.now;
4242
4276
  // timestamp can either be hi-res (relative to page load) or low-res
4243
4277
  // (relative to UNIX epoch), so in order to compare time we have to use the
4244
4278
  // same timestamp type when saving the flush timestamp.
4245
- if (
4246
- inBrowser &&
4247
- window.performance &&
4248
- typeof performance.now === 'function' &&
4249
- document.createEvent('Event').timeStamp <= performance.now()
4250
- ) {
4251
- // if the event timestamp is bigger than the hi-res timestamp
4252
- // (which is evaluated AFTER) it means the event is using a lo-res timestamp,
4253
- // and we need to use the lo-res version for event listeners as well.
4254
- getNow = function () { return performance.now(); };
4279
+ // All IE versions use low-res event timestamps, and have problematic clock
4280
+ // implementations (#9632)
4281
+ if (inBrowser && !isIE) {
4282
+ var performance = window.performance;
4283
+ if (
4284
+ performance &&
4285
+ typeof performance.now === 'function' &&
4286
+ getNow() > document.createEvent('Event').timeStamp
4287
+ ) {
4288
+ // if the event timestamp, although evaluated AFTER the Date.now(), is
4289
+ // smaller than it, it means the event is using a hi-res timestamp,
4290
+ // and we need to use the hi-res version for event listener timestamps as
4291
+ // well.
4292
+ getNow = function () { return performance.now(); };
4293
+ }
4255
4294
  }
4256
4295
 
4257
4296
  /**
@@ -4536,11 +4575,8 @@ Watcher.prototype.run = function run () {
4536
4575
  var oldValue = this.value;
4537
4576
  this.value = value;
4538
4577
  if (this.user) {
4539
- try {
4540
- this.cb.call(this.vm, value, oldValue);
4541
- } catch (e) {
4542
- handleError(e, this.vm, ("callback for watcher \"" + (this.expression) + "\""));
4543
- }
4578
+ var info = "callback for watcher \"" + (this.expression) + "\"";
4579
+ invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info);
4544
4580
  } else {
4545
4581
  this.cb.call(this.vm, value, oldValue);
4546
4582
  }
@@ -4762,6 +4798,8 @@ function initComputed (vm, computed) {
4762
4798
  warn(("The computed property \"" + key + "\" is already defined in data."), vm);
4763
4799
  } else if (vm.$options.props && key in vm.$options.props) {
4764
4800
  warn(("The computed property \"" + key + "\" is already defined as a prop."), vm);
4801
+ } else if (vm.$options.methods && key in vm.$options.methods) {
4802
+ warn(("The computed property \"" + key + "\" is already defined as a method."), vm);
4765
4803
  }
4766
4804
  }
4767
4805
  }
@@ -4914,11 +4952,10 @@ function stateMixin (Vue) {
4914
4952
  options.user = true;
4915
4953
  var watcher = new Watcher(vm, expOrFn, cb, options);
4916
4954
  if (options.immediate) {
4917
- try {
4918
- cb.call(vm, watcher.value);
4919
- } catch (error) {
4920
- handleError(error, vm, ("callback for immediate watcher \"" + (watcher.expression) + "\""));
4921
- }
4955
+ var info = "callback for immediate watcher \"" + (watcher.expression) + "\"";
4956
+ pushTarget();
4957
+ invokeWithErrorHandling(cb, vm, [watcher.value], vm, info);
4958
+ popTarget();
4922
4959
  }
4923
4960
  return function unwatchFn () {
4924
4961
  watcher.teardown();
@@ -5216,6 +5253,8 @@ function initAssetRegisters (Vue) {
5216
5253
 
5217
5254
 
5218
5255
 
5256
+
5257
+
5219
5258
  function getComponentName (opts) {
5220
5259
  return opts && (opts.Ctor.options.name || opts.tag)
5221
5260
  }
@@ -5237,9 +5276,9 @@ function pruneCache (keepAliveInstance, filter) {
5237
5276
  var keys = keepAliveInstance.keys;
5238
5277
  var _vnode = keepAliveInstance._vnode;
5239
5278
  for (var key in cache) {
5240
- var cachedNode = cache[key];
5241
- if (cachedNode) {
5242
- var name = getComponentName(cachedNode.componentOptions);
5279
+ var entry = cache[key];
5280
+ if (entry) {
5281
+ var name = entry.name;
5243
5282
  if (name && !filter(name)) {
5244
5283
  pruneCacheEntry(cache, key, keys, _vnode);
5245
5284
  }
@@ -5253,9 +5292,9 @@ function pruneCacheEntry (
5253
5292
  keys,
5254
5293
  current
5255
5294
  ) {
5256
- var cached$$1 = cache[key];
5257
- if (cached$$1 && (!current || cached$$1.tag !== current.tag)) {
5258
- cached$$1.componentInstance.$destroy();
5295
+ var entry = cache[key];
5296
+ if (entry && (!current || entry.tag !== current.tag)) {
5297
+ entry.componentInstance.$destroy();
5259
5298
  }
5260
5299
  cache[key] = null;
5261
5300
  remove(keys, key);
@@ -5273,6 +5312,32 @@ var KeepAlive = {
5273
5312
  max: [String, Number]
5274
5313
  },
5275
5314
 
5315
+ methods: {
5316
+ cacheVNode: function cacheVNode() {
5317
+ var ref = this;
5318
+ var cache = ref.cache;
5319
+ var keys = ref.keys;
5320
+ var vnodeToCache = ref.vnodeToCache;
5321
+ var keyToCache = ref.keyToCache;
5322
+ if (vnodeToCache) {
5323
+ var tag = vnodeToCache.tag;
5324
+ var componentInstance = vnodeToCache.componentInstance;
5325
+ var componentOptions = vnodeToCache.componentOptions;
5326
+ cache[keyToCache] = {
5327
+ name: getComponentName(componentOptions),
5328
+ tag: tag,
5329
+ componentInstance: componentInstance,
5330
+ };
5331
+ keys.push(keyToCache);
5332
+ // prune oldest entry
5333
+ if (this.max && keys.length > parseInt(this.max)) {
5334
+ pruneCacheEntry(cache, keys[0], keys, this._vnode);
5335
+ }
5336
+ this.vnodeToCache = null;
5337
+ }
5338
+ }
5339
+ },
5340
+
5276
5341
  created: function created () {
5277
5342
  this.cache = Object.create(null);
5278
5343
  this.keys = [];
@@ -5287,6 +5352,7 @@ var KeepAlive = {
5287
5352
  mounted: function mounted () {
5288
5353
  var this$1 = this;
5289
5354
 
5355
+ this.cacheVNode();
5290
5356
  this.$watch('include', function (val) {
5291
5357
  pruneCache(this$1, function (name) { return matches(val, name); });
5292
5358
  });
@@ -5295,6 +5361,10 @@ var KeepAlive = {
5295
5361
  });
5296
5362
  },
5297
5363
 
5364
+ updated: function updated () {
5365
+ this.cacheVNode();
5366
+ },
5367
+
5298
5368
  render: function render () {
5299
5369
  var slot = this.$slots.default;
5300
5370
  var vnode = getFirstComponentChild(slot);
@@ -5328,12 +5398,9 @@ var KeepAlive = {
5328
5398
  remove(keys, key);
5329
5399
  keys.push(key);
5330
5400
  } else {
5331
- cache[key] = vnode;
5332
- keys.push(key);
5333
- // prune oldest entry
5334
- if (this.max && keys.length > parseInt(this.max)) {
5335
- pruneCacheEntry(cache, keys[0], keys, this._vnode);
5336
- }
5401
+ // delay setting the cache until update
5402
+ this.vnodeToCache = vnode;
5403
+ this.keyToCache = key;
5337
5404
  }
5338
5405
 
5339
5406
  vnode.data.keepAlive = true;
@@ -5416,7 +5483,7 @@ Object.defineProperty(Vue, 'FunctionalRenderContext', {
5416
5483
  value: FunctionalRenderContext
5417
5484
  });
5418
5485
 
5419
- Vue.version = '2.6.9';
5486
+ Vue.version = '2.6.13';
5420
5487
 
5421
5488
  /* */
5422
5489
 
@@ -5453,7 +5520,7 @@ var isBooleanAttr = makeMap(
5453
5520
  'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' +
5454
5521
  'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' +
5455
5522
  'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' +
5456
- 'required,reversed,scoped,seamless,selected,sortable,translate,' +
5523
+ 'required,reversed,scoped,seamless,selected,sortable,' +
5457
5524
  'truespeed,typemustmatch,visible'
5458
5525
  );
5459
5526
 
@@ -5577,7 +5644,7 @@ var isHTMLTag = makeMap(
5577
5644
  // contain child elements.
5578
5645
  var isSVG = makeMap(
5579
5646
  'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' +
5580
- 'foreignObject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
5647
+ 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' +
5581
5648
  'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view',
5582
5649
  true
5583
5650
  );
@@ -5782,7 +5849,8 @@ var hooks = ['create', 'activate', 'update', 'remove', 'destroy'];
5782
5849
 
5783
5850
  function sameVnode (a, b) {
5784
5851
  return (
5785
- a.key === b.key && (
5852
+ a.key === b.key &&
5853
+ a.asyncFactory === b.asyncFactory && (
5786
5854
  (
5787
5855
  a.tag === b.tag &&
5788
5856
  a.isComment === b.isComment &&
@@ -5790,7 +5858,6 @@ function sameVnode (a, b) {
5790
5858
  sameInputType(a, b)
5791
5859
  ) || (
5792
5860
  isTrue(a.isAsyncPlaceholder) &&
5793
- a.asyncFactory === b.asyncFactory &&
5794
5861
  isUndef(b.asyncFactory.error)
5795
5862
  )
5796
5863
  )
@@ -6089,7 +6156,7 @@ function createPatchFunction (backend) {
6089
6156
  }
6090
6157
  }
6091
6158
 
6092
- function removeVnodes (parentElm, vnodes, startIdx, endIdx) {
6159
+ function removeVnodes (vnodes, startIdx, endIdx) {
6093
6160
  for (; startIdx <= endIdx; ++startIdx) {
6094
6161
  var ch = vnodes[startIdx];
6095
6162
  if (isDef(ch)) {
@@ -6200,7 +6267,7 @@ function createPatchFunction (backend) {
6200
6267
  refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm;
6201
6268
  addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue);
6202
6269
  } else if (newStartIdx > newEndIdx) {
6203
- removeVnodes(parentElm, oldCh, oldStartIdx, oldEndIdx);
6270
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
6204
6271
  }
6205
6272
  }
6206
6273
 
@@ -6292,7 +6359,7 @@ function createPatchFunction (backend) {
6292
6359
  if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); }
6293
6360
  addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue);
6294
6361
  } else if (isDef(oldCh)) {
6295
- removeVnodes(elm, oldCh, 0, oldCh.length - 1);
6362
+ removeVnodes(oldCh, 0, oldCh.length - 1);
6296
6363
  } else if (isDef(oldVnode.text)) {
6297
6364
  nodeOps.setTextContent(elm, '');
6298
6365
  }
@@ -6521,7 +6588,7 @@ function createPatchFunction (backend) {
6521
6588
 
6522
6589
  // destroy old node
6523
6590
  if (isDef(parentElm)) {
6524
- removeVnodes(parentElm, [oldVnode], 0, 0);
6591
+ removeVnodes([oldVnode], 0, 0);
6525
6592
  } else if (isDef(oldVnode.tag)) {
6526
6593
  invokeDestroyHook(oldVnode);
6527
6594
  }
@@ -6678,7 +6745,7 @@ function updateAttrs (oldVnode, vnode) {
6678
6745
  cur = attrs[key];
6679
6746
  old = oldAttrs[key];
6680
6747
  if (old !== cur) {
6681
- setAttr(elm, key, cur);
6748
+ setAttr(elm, key, cur, vnode.data.pre);
6682
6749
  }
6683
6750
  }
6684
6751
  // #4391: in IE9, setting type can reset value for input[type=radio]
@@ -6698,8 +6765,8 @@ function updateAttrs (oldVnode, vnode) {
6698
6765
  }
6699
6766
  }
6700
6767
 
6701
- function setAttr (el, key, value) {
6702
- if (el.tagName.indexOf('-') > -1) {
6768
+ function setAttr (el, key, value, isInPre) {
6769
+ if (isInPre || el.tagName.indexOf('-') > -1) {
6703
6770
  baseSetAttr(el, key, value);
6704
6771
  } else if (isBooleanAttr(key)) {
6705
6772
  // set attribute for blank value
@@ -7578,10 +7645,11 @@ function updateDOMProps (oldVnode, vnode) {
7578
7645
  }
7579
7646
 
7580
7647
  for (key in oldProps) {
7581
- if (isUndef(props[key])) {
7648
+ if (!(key in props)) {
7582
7649
  elm[key] = '';
7583
7650
  }
7584
7651
  }
7652
+
7585
7653
  for (key in props) {
7586
7654
  cur = props[key];
7587
7655
  // ignore children if the node has textContent or innerHTML,
@@ -7621,7 +7689,7 @@ function updateDOMProps (oldVnode, vnode) {
7621
7689
  // skip the update if old and new VDOM state is the same.
7622
7690
  // `value` is handled separately because the DOM value may be temporarily
7623
7691
  // out of sync with VDOM state due to focus, composition and modifiers.
7624
- // This #4521 by skipping the unnecesarry `checked` update.
7692
+ // This #4521 by skipping the unnecessary `checked` update.
7625
7693
  cur !== oldProps[key]
7626
7694
  ) {
7627
7695
  // some property updates can throw
@@ -9219,14 +9287,14 @@ var isNonPhrasingTag = makeMap(
9219
9287
 
9220
9288
  // Regular Expressions for parsing tags and attributes
9221
9289
  var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
9222
- var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
9290
+ var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/;
9223
9291
  var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*";
9224
9292
  var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")";
9225
9293
  var startTagOpen = new RegExp(("^<" + qnameCapture));
9226
9294
  var startTagClose = /^\s*(\/?)>/;
9227
9295
  var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>"));
9228
9296
  var doctype = /^<!DOCTYPE [^>]+>/i;
9229
- // #7298: escape - to avoid being pased as HTML comment when inlined in page
9297
+ // #7298: escape - to avoid being passed as HTML comment when inlined in page
9230
9298
  var comment = /^<!\--/;
9231
9299
  var conditionalComment = /^<!\[/;
9232
9300
 
@@ -9511,7 +9579,7 @@ function parseHTML (html, options) {
9511
9579
  /* */
9512
9580
 
9513
9581
  var onRE = /^@|^v-on:/;
9514
- var dirRE = /^v-|^@|^:/;
9582
+ var dirRE = /^v-|^@|^:|^#/;
9515
9583
  var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/;
9516
9584
  var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/;
9517
9585
  var stripParensRE = /^\(|\)$/g;
@@ -9524,7 +9592,7 @@ var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g;
9524
9592
  var slotRE = /^v-slot(:|$)|^#/;
9525
9593
 
9526
9594
  var lineBreakRE = /[\r\n]/;
9527
- var whitespaceRE$1 = /\s+/g;
9595
+ var whitespaceRE$1 = /[ \f\t\r\n]+/g;
9528
9596
 
9529
9597
  var invalidAttributeRE = /[\s"'<>\/=]/;
9530
9598
 
@@ -9572,8 +9640,12 @@ function parse (
9572
9640
  platformMustUseProp = options.mustUseProp || no;
9573
9641
  platformGetTagNamespace = options.getTagNamespace || no;
9574
9642
  var isReservedTag = options.isReservedTag || no;
9575
- maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); };
9576
-
9643
+ maybeComponent = function (el) { return !!(
9644
+ el.component ||
9645
+ el.attrsMap[':is'] ||
9646
+ el.attrsMap['v-bind:is'] ||
9647
+ !(el.attrsMap.is ? isReservedTag(el.attrsMap.is) : isReservedTag(el.tag))
9648
+ ); };
9577
9649
  transforms = pluckModuleFunction(options.modules, 'transformNode');
9578
9650
  preTransforms = pluckModuleFunction(options.modules, 'preTransformNode');
9579
9651
  postTransforms = pluckModuleFunction(options.modules, 'postTransformNode');
@@ -9866,7 +9938,7 @@ function parse (
9866
9938
  }
9867
9939
  },
9868
9940
  comment: function comment (text, start, end) {
9869
- // adding anyting as a sibling to the root node is forbidden
9941
+ // adding anything as a sibling to the root node is forbidden
9870
9942
  // comments should still be allowed, but ignored
9871
9943
  if (currentParent) {
9872
9944
  var child = {
@@ -10135,7 +10207,7 @@ function processSlotContent (el) {
10135
10207
  if (el.parent && !maybeComponent(el.parent)) {
10136
10208
  warn$2(
10137
10209
  "<template v-slot> can only appear at the root level inside " +
10138
- "the receiving the component",
10210
+ "the receiving component",
10139
10211
  el
10140
10212
  );
10141
10213
  }
@@ -10698,7 +10770,7 @@ function isDirectChildOfTemplateFor (node) {
10698
10770
 
10699
10771
  /* */
10700
10772
 
10701
- var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function\s*\(/;
10773
+ var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/;
10702
10774
  var fnInvokeRE = /\([^)]*?\);*$/;
10703
10775
  var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/;
10704
10776
 
@@ -10822,9 +10894,9 @@ function genHandler (handler) {
10822
10894
  code += genModifierCode;
10823
10895
  }
10824
10896
  var handlerCode = isMethodPath
10825
- ? ("return " + (handler.value) + "($event)")
10897
+ ? ("return " + (handler.value) + ".apply(null, arguments)")
10826
10898
  : isFunctionExpression
10827
- ? ("return (" + (handler.value) + ")($event)")
10899
+ ? ("return (" + (handler.value) + ").apply(null, arguments)")
10828
10900
  : isFunctionInvocation
10829
10901
  ? ("return " + (handler.value))
10830
10902
  : handler.value;
@@ -10910,7 +10982,8 @@ function generate (
10910
10982
  options
10911
10983
  ) {
10912
10984
  var state = new CodegenState(options);
10913
- var code = ast ? genElement(ast, state) : '_c("div")';
10985
+ // fix #11483, Root level <script> tags should not be rendered.
10986
+ var code = ast ? (ast.tag === 'script' ? 'null' : genElement(ast, state)) : '_c("div")';
10914
10987
  return {
10915
10988
  render: ("with(this){return " + code + "}"),
10916
10989
  staticRenderFns: state.staticRenderFns
@@ -11372,7 +11445,7 @@ function genComment (comment) {
11372
11445
  function genSlot (el, state) {
11373
11446
  var slotName = el.slotName || '"default"';
11374
11447
  var children = genChildren(el, state);
11375
- var res = "_t(" + slotName + (children ? ("," + children) : '');
11448
+ var res = "_t(" + slotName + (children ? (",function(){return " + children + "}") : '');
11376
11449
  var attrs = el.attrs || el.dynamicAttrs
11377
11450
  ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({
11378
11451
  // slot props are camelized
@@ -11467,6 +11540,8 @@ function checkNode (node, warn) {
11467
11540
  var range = node.rawAttrsMap[name];
11468
11541
  if (name === 'v-for') {
11469
11542
  checkFor(node, ("v-for=\"" + value + "\""), warn, range);
11543
+ } else if (name === 'v-slot' || name[0] === '#') {
11544
+ checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range);
11470
11545
  } else if (onRE.test(name)) {
11471
11546
  checkEvent(value, (name + "=\"" + value + "\""), warn, range);
11472
11547
  } else {
@@ -11486,9 +11561,9 @@ function checkNode (node, warn) {
11486
11561
  }
11487
11562
 
11488
11563
  function checkEvent (exp, text, warn, range) {
11489
- var stipped = exp.replace(stripStringRE, '');
11490
- var keywordMatch = stipped.match(unaryOperatorsRE);
11491
- if (keywordMatch && stipped.charAt(keywordMatch.index - 1) !== '$') {
11564
+ var stripped = exp.replace(stripStringRE, '');
11565
+ var keywordMatch = stripped.match(unaryOperatorsRE);
11566
+ if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') {
11492
11567
  warn(
11493
11568
  "avoid using JavaScript unary operator as property name: " +
11494
11569
  "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()),
@@ -11543,6 +11618,19 @@ function checkExpression (exp, text, warn, range) {
11543
11618
  }
11544
11619
  }
11545
11620
 
11621
+ function checkFunctionParameterExpression (exp, text, warn, range) {
11622
+ try {
11623
+ new Function(exp, '');
11624
+ } catch (e) {
11625
+ warn(
11626
+ "invalid function parameter expression: " + (e.message) + " in\n\n" +
11627
+ " " + exp + "\n\n" +
11628
+ " Raw expression: " + (text.trim()) + "\n",
11629
+ range
11630
+ );
11631
+ }
11632
+ }
11633
+
11546
11634
  /* */
11547
11635
 
11548
11636
  var range = 2;