@vue/compat 3.4.21 → 3.4.22

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.
@@ -1,8 +1,10 @@
1
1
  /**
2
- * @vue/compat v3.4.21
2
+ * @vue/compat v3.4.22
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
+ /*! #__NO_SIDE_EFFECTS__ */
7
+ // @__NO_SIDE_EFFECTS__
6
8
  function makeMap(str, expectsLowerCase) {
7
9
  const set = new Set(str.split(","));
8
10
  return expectsLowerCase ? (val) => set.has(val.toLowerCase()) : (val) => set.has(val);
@@ -289,7 +291,11 @@ const replacer = (_key, val) => {
289
291
  };
290
292
  const stringifySymbol = (v, i = "") => {
291
293
  var _a;
292
- return isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v;
294
+ return (
295
+ // Symbol.description in es2019+ so we need to cast here to pass
296
+ // the lib: es2016 check
297
+ isSymbol(v) ? `Symbol(${(_a = v.description) != null ? _a : i})` : v
298
+ );
293
299
  };
294
300
 
295
301
  function warn$2(msg, ...args) {
@@ -725,6 +731,8 @@ function createArrayInstrumentations() {
725
731
  return instrumentations;
726
732
  }
727
733
  function hasOwnProperty(key) {
734
+ if (!isSymbol(key))
735
+ key = String(key);
728
736
  const obj = toRaw(this);
729
737
  track(obj, "has", key);
730
738
  return obj.hasOwnProperty(key);
@@ -1077,23 +1085,16 @@ function createInstrumentations() {
1077
1085
  clear: createReadonlyMethod("clear"),
1078
1086
  forEach: createForEach(true, true)
1079
1087
  };
1080
- const iteratorMethods = ["keys", "values", "entries", Symbol.iterator];
1088
+ const iteratorMethods = [
1089
+ "keys",
1090
+ "values",
1091
+ "entries",
1092
+ Symbol.iterator
1093
+ ];
1081
1094
  iteratorMethods.forEach((method) => {
1082
- mutableInstrumentations2[method] = createIterableMethod(
1083
- method,
1084
- false,
1085
- false
1086
- );
1087
- readonlyInstrumentations2[method] = createIterableMethod(
1088
- method,
1089
- true,
1090
- false
1091
- );
1092
- shallowInstrumentations2[method] = createIterableMethod(
1093
- method,
1094
- false,
1095
- true
1096
- );
1095
+ mutableInstrumentations2[method] = createIterableMethod(method, false, false);
1096
+ readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
1097
+ shallowInstrumentations2[method] = createIterableMethod(method, false, true);
1097
1098
  shallowReadonlyInstrumentations2[method] = createIterableMethod(
1098
1099
  method,
1099
1100
  true,
@@ -1250,7 +1251,7 @@ function isShallow(value) {
1250
1251
  return !!(value && value["__v_isShallow"]);
1251
1252
  }
1252
1253
  function isProxy(value) {
1253
- return isReactive(value) || isReadonly(value);
1254
+ return value ? !!value["__v_raw"] : false;
1254
1255
  }
1255
1256
  function toRaw(observed) {
1256
1257
  const raw = observed && observed["__v_raw"];
@@ -1714,11 +1715,17 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
1714
1715
  }
1715
1716
  return res;
1716
1717
  }
1717
- const values = [];
1718
- for (let i = 0; i < fn.length; i++) {
1719
- values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1718
+ if (isArray(fn)) {
1719
+ const values = [];
1720
+ for (let i = 0; i < fn.length; i++) {
1721
+ values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1722
+ }
1723
+ return values;
1724
+ } else if (!!(process.env.NODE_ENV !== "production")) {
1725
+ warn$1(
1726
+ `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
1727
+ );
1720
1728
  }
1721
- return values;
1722
1729
  }
1723
1730
  function handleError(err, instance, type, throwInDev = true) {
1724
1731
  const contextVNode = instance ? instance.vnode : null;
@@ -1739,12 +1746,14 @@ function handleError(err, instance, type, throwInDev = true) {
1739
1746
  }
1740
1747
  const appErrorHandler = instance.appContext.config.errorHandler;
1741
1748
  if (appErrorHandler) {
1749
+ pauseTracking();
1742
1750
  callWithErrorHandling(
1743
1751
  appErrorHandler,
1744
1752
  null,
1745
1753
  10,
1746
1754
  [err, exposedInstance, errorInfo]
1747
1755
  );
1756
+ resetTracking();
1748
1757
  return;
1749
1758
  }
1750
1759
  }
@@ -2122,6 +2131,8 @@ const devtoolsComponentRemoved = (component) => {
2122
2131
  _devtoolsComponentRemoved(component);
2123
2132
  }
2124
2133
  };
2134
+ /*! #__NO_SIDE_EFFECTS__ */
2135
+ // @__NO_SIDE_EFFECTS__
2125
2136
  function createDevtoolsComponentHook(hook) {
2126
2137
  return (component) => {
2127
2138
  emit$2(
@@ -4805,7 +4816,7 @@ const KeepAliveImpl = {
4805
4816
  return () => {
4806
4817
  pendingCacheKey = null;
4807
4818
  if (!slots.default) {
4808
- return null;
4819
+ return current = null;
4809
4820
  }
4810
4821
  const children = slots.default();
4811
4822
  const rawVNode = children[0];
@@ -5536,47 +5547,74 @@ function installCompatInstanceProperties(map) {
5536
5547
  $once: (i) => once.bind(null, i),
5537
5548
  $off: (i) => off.bind(null, i),
5538
5549
  $children: getCompatChildren,
5539
- $listeners: getCompatListeners
5550
+ $listeners: getCompatListeners,
5551
+ // inject additional properties into $options for compat
5552
+ // e.g. vuex needs this.$options.parent
5553
+ $options: (i) => {
5554
+ if (!isCompatEnabled("PRIVATE_APIS", i)) {
5555
+ return resolveMergedOptions(i);
5556
+ }
5557
+ if (i.resolvedOptions) {
5558
+ return i.resolvedOptions;
5559
+ }
5560
+ const res = i.resolvedOptions = extend({}, resolveMergedOptions(i));
5561
+ Object.defineProperties(res, {
5562
+ parent: {
5563
+ get() {
5564
+ warnDeprecation("PRIVATE_APIS", i, "$options.parent");
5565
+ return i.proxy.$parent;
5566
+ }
5567
+ },
5568
+ propsData: {
5569
+ get() {
5570
+ warnDeprecation(
5571
+ "PRIVATE_APIS",
5572
+ i,
5573
+ "$options.propsData"
5574
+ );
5575
+ return i.vnode.props;
5576
+ }
5577
+ }
5578
+ });
5579
+ return res;
5580
+ }
5540
5581
  });
5541
- if (isCompatEnabled("PRIVATE_APIS", null)) {
5542
- extend(map, {
5543
- // needed by many libs / render fns
5544
- $vnode: (i) => i.vnode,
5545
- // inject additional properties into $options for compat
5546
- // e.g. vuex needs this.$options.parent
5547
- $options: (i) => {
5548
- const res = extend({}, resolveMergedOptions(i));
5549
- res.parent = i.proxy.$parent;
5550
- res.propsData = i.vnode.props;
5551
- return res;
5552
- },
5553
- // some private properties that are likely accessed...
5554
- _self: (i) => i.proxy,
5555
- _uid: (i) => i.uid,
5556
- _data: (i) => i.data,
5557
- _isMounted: (i) => i.isMounted,
5558
- _isDestroyed: (i) => i.isUnmounted,
5559
- // v2 render helpers
5560
- $createElement: () => compatH,
5561
- _c: () => compatH,
5562
- _o: () => legacyMarkOnce,
5563
- _n: () => looseToNumber,
5564
- _s: () => toDisplayString,
5565
- _l: () => renderList,
5566
- _t: (i) => legacyRenderSlot.bind(null, i),
5567
- _q: () => looseEqual,
5568
- _i: () => looseIndexOf,
5569
- _m: (i) => legacyRenderStatic.bind(null, i),
5570
- _f: () => resolveFilter$1,
5571
- _k: (i) => legacyCheckKeyCodes.bind(null, i),
5572
- _b: () => legacyBindObjectProps,
5573
- _v: () => createTextVNode,
5574
- _e: () => createCommentVNode,
5575
- _u: () => legacyresolveScopedSlots,
5576
- _g: () => legacyBindObjectListeners,
5577
- _d: () => legacyBindDynamicKeys,
5578
- _p: () => legacyPrependModifier
5579
- });
5582
+ const privateAPIs = {
5583
+ // needed by many libs / render fns
5584
+ $vnode: (i) => i.vnode,
5585
+ // some private properties that are likely accessed...
5586
+ _self: (i) => i.proxy,
5587
+ _uid: (i) => i.uid,
5588
+ _data: (i) => i.data,
5589
+ _isMounted: (i) => i.isMounted,
5590
+ _isDestroyed: (i) => i.isUnmounted,
5591
+ // v2 render helpers
5592
+ $createElement: () => compatH,
5593
+ _c: () => compatH,
5594
+ _o: () => legacyMarkOnce,
5595
+ _n: () => looseToNumber,
5596
+ _s: () => toDisplayString,
5597
+ _l: () => renderList,
5598
+ _t: (i) => legacyRenderSlot.bind(null, i),
5599
+ _q: () => looseEqual,
5600
+ _i: () => looseIndexOf,
5601
+ _m: (i) => legacyRenderStatic.bind(null, i),
5602
+ _f: () => resolveFilter$1,
5603
+ _k: (i) => legacyCheckKeyCodes.bind(null, i),
5604
+ _b: () => legacyBindObjectProps,
5605
+ _v: () => createTextVNode,
5606
+ _e: () => createCommentVNode,
5607
+ _u: () => legacyresolveScopedSlots,
5608
+ _g: () => legacyBindObjectListeners,
5609
+ _d: () => legacyBindDynamicKeys,
5610
+ _p: () => legacyPrependModifier
5611
+ };
5612
+ for (const key in privateAPIs) {
5613
+ map[key] = (i) => {
5614
+ if (isCompatEnabled("PRIVATE_APIS", i)) {
5615
+ return privateAPIs[key](i);
5616
+ }
5617
+ };
5580
5618
  }
5581
5619
  }
5582
5620
 
@@ -5617,6 +5655,9 @@ const isReservedPrefix = (key) => key === "_" || key === "$";
5617
5655
  const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
5618
5656
  const PublicInstanceProxyHandlers = {
5619
5657
  get({ _: instance }, key) {
5658
+ if (key === "__v_skip") {
5659
+ return true;
5660
+ }
5620
5661
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
5621
5662
  if (!!(process.env.NODE_ENV !== "production") && key === "__isVue") {
5622
5663
  return true;
@@ -6473,7 +6514,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6473
6514
  return vm;
6474
6515
  }
6475
6516
  }
6476
- Vue.version = `2.6.14-compat:${"3.4.21"}`;
6517
+ Vue.version = `2.6.14-compat:${"3.4.22"}`;
6477
6518
  Vue.config = singletonApp.config;
6478
6519
  Vue.use = (p, ...options) => {
6479
6520
  if (p && isFunction(p.install)) {
@@ -6668,15 +6709,14 @@ function applySingletonPrototype(app, Ctor) {
6668
6709
  app.config.globalProperties = Object.create(Ctor.prototype);
6669
6710
  }
6670
6711
  let hasPrototypeAugmentations = false;
6671
- const descriptors = Object.getOwnPropertyDescriptors(Ctor.prototype);
6672
- for (const key in descriptors) {
6712
+ for (const key of Object.getOwnPropertyNames(Ctor.prototype)) {
6673
6713
  if (key !== "constructor") {
6674
6714
  hasPrototypeAugmentations = true;
6675
6715
  if (enabled) {
6676
6716
  Object.defineProperty(
6677
6717
  app.config.globalProperties,
6678
6718
  key,
6679
- descriptors[key]
6719
+ Object.getOwnPropertyDescriptor(Ctor.prototype, key)
6680
6720
  );
6681
6721
  }
6682
6722
  }
@@ -7114,10 +7154,10 @@ function shouldSkipAttr(key, instance) {
7114
7154
  return false;
7115
7155
  }
7116
7156
 
7157
+ const attrsProto = {};
7117
7158
  function initProps(instance, rawProps, isStateful, isSSR = false) {
7118
7159
  const props = {};
7119
- const attrs = {};
7120
- def(attrs, InternalObjectKey, 1);
7160
+ const attrs = Object.create(attrsProto);
7121
7161
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
7122
7162
  setFullProps(instance, rawProps, props, attrs);
7123
7163
  for (const key in instance.propsOptions[0]) {
@@ -7239,7 +7279,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
7239
7279
  }
7240
7280
  }
7241
7281
  if (hasAttrsChanged) {
7242
- trigger(instance, "set", "$attrs");
7282
+ trigger(instance.attrs, "set", "");
7243
7283
  }
7244
7284
  if (!!(process.env.NODE_ENV !== "production")) {
7245
7285
  validateProps(rawProps || {}, props, instance);
@@ -7597,7 +7637,7 @@ const initSlots = (instance, children) => {
7597
7637
  const type = children._;
7598
7638
  if (type) {
7599
7639
  instance.slots = toRaw(children);
7600
- def(children, "_", type);
7640
+ def(instance.slots, "_", type);
7601
7641
  } else {
7602
7642
  normalizeObjectSlots(
7603
7643
  children,
@@ -7611,7 +7651,6 @@ const initSlots = (instance, children) => {
7611
7651
  normalizeVNodeSlots(instance, children);
7612
7652
  }
7613
7653
  }
7614
- def(instance.slots, InternalObjectKey, 1);
7615
7654
  };
7616
7655
  const updateSlots = (instance, children, optimized) => {
7617
7656
  const { vnode, slots } = instance;
@@ -7783,6 +7822,7 @@ function createHydrationFunctions(rendererInternals) {
7783
7822
  }
7784
7823
  };
7785
7824
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
7825
+ optimized = optimized || !!vnode.dynamicChildren;
7786
7826
  const isFragmentStart = isComment(node) && node.data === "[";
7787
7827
  const onMismatch = () => handleMismatch(
7788
7828
  node,
@@ -8028,9 +8068,9 @@ Server rendered element contains more child nodes than client vdom.`
8028
8068
  }
8029
8069
  }
8030
8070
  if (props) {
8031
- if (!!(process.env.NODE_ENV !== "production") || forcePatch || !optimized || patchFlag & (16 | 32)) {
8071
+ if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__ || forcePatch || !optimized || patchFlag & (16 | 32)) {
8032
8072
  for (const key in props) {
8033
- if (!!(process.env.NODE_ENV !== "production") && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
8073
+ if ((!!(process.env.NODE_ENV !== "production") || __VUE_PROD_HYDRATION_MISMATCH_DETAILS__) && propHasMismatch(el, key, props[key], vnode, parentComponent)) {
8034
8074
  hasMismatch = true;
8035
8075
  }
8036
8076
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -10350,7 +10390,6 @@ const createVNodeWithArgsTransform = (...args) => {
10350
10390
  ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
10351
10391
  );
10352
10392
  };
10353
- const InternalObjectKey = `__vInternal`;
10354
10393
  const normalizeKey = ({ key }) => key != null ? key : null;
10355
10394
  const normalizeRef = ({
10356
10395
  ref,
@@ -10490,7 +10529,7 @@ Component that was made reactive: `,
10490
10529
  function guardReactiveProps(props) {
10491
10530
  if (!props)
10492
10531
  return null;
10493
- return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
10532
+ return isProxy(props) || Object.getPrototypeOf(props) === attrsProto ? extend({}, props) : props;
10494
10533
  }
10495
10534
  function cloneVNode(vnode, extraProps, mergeRef = false) {
10496
10535
  const { props, ref, patchFlag, children } = vnode;
@@ -10598,7 +10637,7 @@ function normalizeChildren(vnode, children) {
10598
10637
  } else {
10599
10638
  type = 32;
10600
10639
  const slotFlag = children._;
10601
- if (!slotFlag && !(InternalObjectKey in children)) {
10640
+ if (!slotFlag) {
10602
10641
  children._ctx = currentRenderingInstance;
10603
10642
  } else if (slotFlag === 3 && currentRenderingInstance) {
10604
10643
  if (currentRenderingInstance.slots._ === 1) {
@@ -10836,7 +10875,7 @@ function setupStatefulComponent(instance, isSSR) {
10836
10875
  }
10837
10876
  }
10838
10877
  instance.accessCache = /* @__PURE__ */ Object.create(null);
10839
- instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
10878
+ instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
10840
10879
  if (!!(process.env.NODE_ENV !== "production")) {
10841
10880
  exposePropsOnRenderContext(instance);
10842
10881
  }
@@ -10982,31 +11021,26 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10982
11021
  }
10983
11022
  }
10984
11023
  }
10985
- function getAttrsProxy(instance) {
10986
- return instance.attrsProxy || (instance.attrsProxy = new Proxy(
10987
- instance.attrs,
10988
- !!(process.env.NODE_ENV !== "production") ? {
10989
- get(target, key) {
10990
- markAttrsAccessed();
10991
- track(instance, "get", "$attrs");
10992
- return target[key];
10993
- },
10994
- set() {
10995
- warn$1(`setupContext.attrs is readonly.`);
10996
- return false;
10997
- },
10998
- deleteProperty() {
10999
- warn$1(`setupContext.attrs is readonly.`);
11000
- return false;
11001
- }
11002
- } : {
11003
- get(target, key) {
11004
- track(instance, "get", "$attrs");
11005
- return target[key];
11006
- }
11007
- }
11008
- ));
11009
- }
11024
+ const attrsProxyHandlers = !!(process.env.NODE_ENV !== "production") ? {
11025
+ get(target, key) {
11026
+ markAttrsAccessed();
11027
+ track(target, "get", "");
11028
+ return target[key];
11029
+ },
11030
+ set() {
11031
+ warn$1(`setupContext.attrs is readonly.`);
11032
+ return false;
11033
+ },
11034
+ deleteProperty() {
11035
+ warn$1(`setupContext.attrs is readonly.`);
11036
+ return false;
11037
+ }
11038
+ } : {
11039
+ get(target, key) {
11040
+ track(target, "get", "");
11041
+ return target[key];
11042
+ }
11043
+ };
11010
11044
  function getSlotsProxy(instance) {
11011
11045
  return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
11012
11046
  get(target, key) {
@@ -11040,9 +11074,10 @@ function createSetupContext(instance) {
11040
11074
  instance.exposed = exposed || {};
11041
11075
  };
11042
11076
  if (!!(process.env.NODE_ENV !== "production")) {
11077
+ let attrsProxy;
11043
11078
  return Object.freeze({
11044
11079
  get attrs() {
11045
- return getAttrsProxy(instance);
11080
+ return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
11046
11081
  },
11047
11082
  get slots() {
11048
11083
  return getSlotsProxy(instance);
@@ -11054,9 +11089,7 @@ function createSetupContext(instance) {
11054
11089
  });
11055
11090
  } else {
11056
11091
  return {
11057
- get attrs() {
11058
- return getAttrsProxy(instance);
11059
- },
11092
+ attrs: new Proxy(instance.attrs, attrsProxyHandlers),
11060
11093
  slots: instance.slots,
11061
11094
  emit: instance.emit,
11062
11095
  expose
@@ -11396,7 +11429,7 @@ function isMemoSame(cached, memo) {
11396
11429
  return true;
11397
11430
  }
11398
11431
 
11399
- const version = "3.4.21";
11432
+ const version = "3.4.22";
11400
11433
  const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
11401
11434
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11402
11435
  const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
@@ -11881,8 +11914,8 @@ function useCssVars(getter) {
11881
11914
  setVarsOnVNode(instance.subTree, vars);
11882
11915
  updateTeleports(vars);
11883
11916
  };
11884
- watchPostEffect(setVars);
11885
11917
  onMounted(() => {
11918
+ watchPostEffect(setVars);
11886
11919
  const ob = new MutationObserver(setVars);
11887
11920
  ob.observe(instance.subTree.el.parentNode, { childList: true });
11888
11921
  onUnmounted(() => ob.disconnect());
@@ -12148,11 +12181,14 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
12148
12181
  const invokers = el[veiKey] || (el[veiKey] = {});
12149
12182
  const existingInvoker = invokers[rawName];
12150
12183
  if (nextValue && existingInvoker) {
12151
- existingInvoker.value = nextValue;
12184
+ existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue;
12152
12185
  } else {
12153
12186
  const [name, options] = parseName(rawName);
12154
12187
  if (nextValue) {
12155
- const invoker = invokers[rawName] = createInvoker(nextValue, instance);
12188
+ const invoker = invokers[rawName] = createInvoker(
12189
+ !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue,
12190
+ instance
12191
+ );
12156
12192
  addEventListener(el, name, invoker, options);
12157
12193
  } else if (existingInvoker) {
12158
12194
  removeEventListener(el, name, existingInvoker, options);
@@ -12195,6 +12231,16 @@ function createInvoker(initialValue, instance) {
12195
12231
  invoker.attached = getNow();
12196
12232
  return invoker;
12197
12233
  }
12234
+ function sanitizeEventValue(value, propName) {
12235
+ if (isFunction(value) || isArray(value)) {
12236
+ return value;
12237
+ }
12238
+ warn(
12239
+ `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
12240
+ Expected function or array of functions, received type ${typeof value}.`
12241
+ );
12242
+ return NOOP;
12243
+ }
12198
12244
  function patchStopImmediatePropagation(e, value) {
12199
12245
  if (isArray(value)) {
12200
12246
  const originalStop = e.stopImmediatePropagation;
@@ -12202,7 +12248,9 @@ function patchStopImmediatePropagation(e, value) {
12202
12248
  originalStop.call(e);
12203
12249
  e._stopped = true;
12204
12250
  };
12205
- return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
12251
+ return value.map(
12252
+ (fn) => (e2) => !e2._stopped && fn && fn(e2)
12253
+ );
12206
12254
  } else {
12207
12255
  return value;
12208
12256
  }
@@ -12403,7 +12451,7 @@ class VueElement extends BaseClass {
12403
12451
  }
12404
12452
  }
12405
12453
  _setAttr(key) {
12406
- let value = this.getAttribute(key);
12454
+ let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
12407
12455
  const camelKey = camelize(key);
12408
12456
  if (this._numberProps && this._numberProps[camelKey]) {
12409
12457
  value = toNumber(value);
@@ -12575,7 +12623,28 @@ const TransitionGroupImpl = {
12575
12623
  )) {
12576
12624
  tag = "span";
12577
12625
  }
12578
- prevChildren = children;
12626
+ prevChildren = [];
12627
+ if (children) {
12628
+ for (let i = 0; i < children.length; i++) {
12629
+ const child = children[i];
12630
+ if (child.el && child.el instanceof Element) {
12631
+ prevChildren.push(child);
12632
+ setTransitionHooks(
12633
+ child,
12634
+ resolveTransitionHooks(
12635
+ child,
12636
+ cssTransitionProps,
12637
+ state,
12638
+ instance
12639
+ )
12640
+ );
12641
+ positionMap.set(
12642
+ child,
12643
+ child.el.getBoundingClientRect()
12644
+ );
12645
+ }
12646
+ }
12647
+ }
12579
12648
  children = slots.default ? getTransitionRawChildren(slots.default()) : [];
12580
12649
  for (let i = 0; i < children.length; i++) {
12581
12650
  const child = children[i];
@@ -12588,16 +12657,6 @@ const TransitionGroupImpl = {
12588
12657
  warn(`<TransitionGroup> children must be keyed.`);
12589
12658
  }
12590
12659
  }
12591
- if (prevChildren) {
12592
- for (let i = 0; i < prevChildren.length; i++) {
12593
- const child = prevChildren[i];
12594
- setTransitionHooks(
12595
- child,
12596
- resolveTransitionHooks(child, cssTransitionProps, state, instance)
12597
- );
12598
- positionMap.set(child, child.el.getBoundingClientRect());
12599
- }
12600
- }
12601
12660
  return createVNode(tag, null, children);
12602
12661
  };
12603
12662
  }
@@ -12699,7 +12758,7 @@ const vModelText = {
12699
12758
  el[assignKey] = getModelAssigner(vnode);
12700
12759
  if (el.composing)
12701
12760
  return;
12702
- const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
12761
+ const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
12703
12762
  const newValue = value == null ? "" : value;
12704
12763
  if (elValue === newValue) {
12705
12764
  return;
@@ -12802,14 +12861,14 @@ const vModelSelect = {
12802
12861
  // set value in mounted & updated because <select> relies on its children
12803
12862
  // <option>s.
12804
12863
  mounted(el, { value, modifiers: { number } }) {
12805
- setSelected(el, value, number);
12864
+ setSelected(el, value);
12806
12865
  },
12807
12866
  beforeUpdate(el, _binding, vnode) {
12808
12867
  el[assignKey] = getModelAssigner(vnode);
12809
12868
  },
12810
12869
  updated(el, { value, modifiers: { number } }) {
12811
12870
  if (!el._assigning) {
12812
- setSelected(el, value, number);
12871
+ setSelected(el, value);
12813
12872
  }
12814
12873
  }
12815
12874
  };
@@ -12829,9 +12888,7 @@ function setSelected(el, value, number) {
12829
12888
  if (isArrayValue) {
12830
12889
  const optionType = typeof optionValue;
12831
12890
  if (optionType === "string" || optionType === "number") {
12832
- option.selected = value.includes(
12833
- number ? looseToNumber(optionValue) : optionValue
12834
- );
12891
+ option.selected = value.some((v) => String(v) === String(optionValue));
12835
12892
  } else {
12836
12893
  option.selected = looseIndexOf(value, optionValue) > -1;
12837
12894
  }