@vue/compat 3.4.21 → 3.4.23

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.23
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"];
@@ -1712,11 +1713,17 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
1712
1713
  }
1713
1714
  return res;
1714
1715
  }
1715
- const values = [];
1716
- for (let i = 0; i < fn.length; i++) {
1717
- values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1716
+ if (isArray(fn)) {
1717
+ const values = [];
1718
+ for (let i = 0; i < fn.length; i++) {
1719
+ values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
1720
+ }
1721
+ return values;
1722
+ } else {
1723
+ warn$1(
1724
+ `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}`
1725
+ );
1718
1726
  }
1719
- return values;
1720
1727
  }
1721
1728
  function handleError(err, instance, type, throwInDev = true) {
1722
1729
  const contextVNode = instance ? instance.vnode : null;
@@ -1737,12 +1744,14 @@ function handleError(err, instance, type, throwInDev = true) {
1737
1744
  }
1738
1745
  const appErrorHandler = instance.appContext.config.errorHandler;
1739
1746
  if (appErrorHandler) {
1747
+ pauseTracking();
1740
1748
  callWithErrorHandling(
1741
1749
  appErrorHandler,
1742
1750
  null,
1743
1751
  10,
1744
1752
  [err, exposedInstance, errorInfo]
1745
1753
  );
1754
+ resetTracking();
1746
1755
  return;
1747
1756
  }
1748
1757
  }
@@ -2118,6 +2127,8 @@ const devtoolsComponentRemoved = (component) => {
2118
2127
  _devtoolsComponentRemoved(component);
2119
2128
  }
2120
2129
  };
2130
+ /*! #__NO_SIDE_EFFECTS__ */
2131
+ // @__NO_SIDE_EFFECTS__
2121
2132
  function createDevtoolsComponentHook(hook) {
2122
2133
  return (component) => {
2123
2134
  emit$2(
@@ -4769,7 +4780,7 @@ const KeepAliveImpl = {
4769
4780
  return () => {
4770
4781
  pendingCacheKey = null;
4771
4782
  if (!slots.default) {
4772
- return null;
4783
+ return current = null;
4773
4784
  }
4774
4785
  const children = slots.default();
4775
4786
  const rawVNode = children[0];
@@ -5500,47 +5511,74 @@ function installCompatInstanceProperties(map) {
5500
5511
  $once: (i) => once.bind(null, i),
5501
5512
  $off: (i) => off.bind(null, i),
5502
5513
  $children: getCompatChildren,
5503
- $listeners: getCompatListeners
5514
+ $listeners: getCompatListeners,
5515
+ // inject additional properties into $options for compat
5516
+ // e.g. vuex needs this.$options.parent
5517
+ $options: (i) => {
5518
+ if (!isCompatEnabled("PRIVATE_APIS", i)) {
5519
+ return resolveMergedOptions(i);
5520
+ }
5521
+ if (i.resolvedOptions) {
5522
+ return i.resolvedOptions;
5523
+ }
5524
+ const res = i.resolvedOptions = extend({}, resolveMergedOptions(i));
5525
+ Object.defineProperties(res, {
5526
+ parent: {
5527
+ get() {
5528
+ warnDeprecation("PRIVATE_APIS", i, "$options.parent");
5529
+ return i.proxy.$parent;
5530
+ }
5531
+ },
5532
+ propsData: {
5533
+ get() {
5534
+ warnDeprecation(
5535
+ "PRIVATE_APIS",
5536
+ i,
5537
+ "$options.propsData"
5538
+ );
5539
+ return i.vnode.props;
5540
+ }
5541
+ }
5542
+ });
5543
+ return res;
5544
+ }
5504
5545
  });
5505
- if (isCompatEnabled("PRIVATE_APIS", null)) {
5506
- extend(map, {
5507
- // needed by many libs / render fns
5508
- $vnode: (i) => i.vnode,
5509
- // inject additional properties into $options for compat
5510
- // e.g. vuex needs this.$options.parent
5511
- $options: (i) => {
5512
- const res = extend({}, resolveMergedOptions(i));
5513
- res.parent = i.proxy.$parent;
5514
- res.propsData = i.vnode.props;
5515
- return res;
5516
- },
5517
- // some private properties that are likely accessed...
5518
- _self: (i) => i.proxy,
5519
- _uid: (i) => i.uid,
5520
- _data: (i) => i.data,
5521
- _isMounted: (i) => i.isMounted,
5522
- _isDestroyed: (i) => i.isUnmounted,
5523
- // v2 render helpers
5524
- $createElement: () => compatH,
5525
- _c: () => compatH,
5526
- _o: () => legacyMarkOnce,
5527
- _n: () => looseToNumber,
5528
- _s: () => toDisplayString,
5529
- _l: () => renderList,
5530
- _t: (i) => legacyRenderSlot.bind(null, i),
5531
- _q: () => looseEqual,
5532
- _i: () => looseIndexOf,
5533
- _m: (i) => legacyRenderStatic.bind(null, i),
5534
- _f: () => resolveFilter$1,
5535
- _k: (i) => legacyCheckKeyCodes.bind(null, i),
5536
- _b: () => legacyBindObjectProps,
5537
- _v: () => createTextVNode,
5538
- _e: () => createCommentVNode,
5539
- _u: () => legacyresolveScopedSlots,
5540
- _g: () => legacyBindObjectListeners,
5541
- _d: () => legacyBindDynamicKeys,
5542
- _p: () => legacyPrependModifier
5543
- });
5546
+ const privateAPIs = {
5547
+ // needed by many libs / render fns
5548
+ $vnode: (i) => i.vnode,
5549
+ // some private properties that are likely accessed...
5550
+ _self: (i) => i.proxy,
5551
+ _uid: (i) => i.uid,
5552
+ _data: (i) => i.data,
5553
+ _isMounted: (i) => i.isMounted,
5554
+ _isDestroyed: (i) => i.isUnmounted,
5555
+ // v2 render helpers
5556
+ $createElement: () => compatH,
5557
+ _c: () => compatH,
5558
+ _o: () => legacyMarkOnce,
5559
+ _n: () => looseToNumber,
5560
+ _s: () => toDisplayString,
5561
+ _l: () => renderList,
5562
+ _t: (i) => legacyRenderSlot.bind(null, i),
5563
+ _q: () => looseEqual,
5564
+ _i: () => looseIndexOf,
5565
+ _m: (i) => legacyRenderStatic.bind(null, i),
5566
+ _f: () => resolveFilter$1,
5567
+ _k: (i) => legacyCheckKeyCodes.bind(null, i),
5568
+ _b: () => legacyBindObjectProps,
5569
+ _v: () => createTextVNode,
5570
+ _e: () => createCommentVNode,
5571
+ _u: () => legacyresolveScopedSlots,
5572
+ _g: () => legacyBindObjectListeners,
5573
+ _d: () => legacyBindDynamicKeys,
5574
+ _p: () => legacyPrependModifier
5575
+ };
5576
+ for (const key in privateAPIs) {
5577
+ map[key] = (i) => {
5578
+ if (isCompatEnabled("PRIVATE_APIS", i)) {
5579
+ return privateAPIs[key](i);
5580
+ }
5581
+ };
5544
5582
  }
5545
5583
  }
5546
5584
 
@@ -5581,6 +5619,9 @@ const isReservedPrefix = (key) => key === "_" || key === "$";
5581
5619
  const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn(state, key);
5582
5620
  const PublicInstanceProxyHandlers = {
5583
5621
  get({ _: instance }, key) {
5622
+ if (key === "__v_skip") {
5623
+ return true;
5624
+ }
5584
5625
  const { ctx, setupState, data, props, accessCache, type, appContext } = instance;
5585
5626
  if (key === "__isVue") {
5586
5627
  return true;
@@ -5623,7 +5664,7 @@ const PublicInstanceProxyHandlers = {
5623
5664
  let cssModule, globalProperties;
5624
5665
  if (publicGetter) {
5625
5666
  if (key === "$attrs") {
5626
- track(instance, "get", key);
5667
+ track(instance.attrs, "get", "");
5627
5668
  markAttrsAccessed();
5628
5669
  } else if (key === "$slots") {
5629
5670
  track(instance, "get", key);
@@ -6435,7 +6476,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6435
6476
  return vm;
6436
6477
  }
6437
6478
  }
6438
- Vue.version = `2.6.14-compat:${"3.4.21"}`;
6479
+ Vue.version = `2.6.14-compat:${"3.4.23"}`;
6439
6480
  Vue.config = singletonApp.config;
6440
6481
  Vue.use = (p, ...options) => {
6441
6482
  if (p && isFunction(p.install)) {
@@ -6629,15 +6670,14 @@ function applySingletonPrototype(app, Ctor) {
6629
6670
  app.config.globalProperties = Object.create(Ctor.prototype);
6630
6671
  }
6631
6672
  let hasPrototypeAugmentations = false;
6632
- const descriptors = Object.getOwnPropertyDescriptors(Ctor.prototype);
6633
- for (const key in descriptors) {
6673
+ for (const key of Object.getOwnPropertyNames(Ctor.prototype)) {
6634
6674
  if (key !== "constructor") {
6635
6675
  hasPrototypeAugmentations = true;
6636
6676
  if (enabled) {
6637
6677
  Object.defineProperty(
6638
6678
  app.config.globalProperties,
6639
6679
  key,
6640
- descriptors[key]
6680
+ Object.getOwnPropertyDescriptor(Ctor.prototype, key)
6641
6681
  );
6642
6682
  }
6643
6683
  }
@@ -7073,10 +7113,13 @@ function shouldSkipAttr(key, instance) {
7073
7113
  return false;
7074
7114
  }
7075
7115
 
7116
+ const internalObjectProto = /* @__PURE__ */ Object.create(null);
7117
+ const createInternalObject = () => Object.create(internalObjectProto);
7118
+ const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto;
7119
+
7076
7120
  function initProps(instance, rawProps, isStateful, isSSR = false) {
7077
7121
  const props = {};
7078
- const attrs = {};
7079
- def(attrs, InternalObjectKey, 1);
7122
+ const attrs = createInternalObject();
7080
7123
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
7081
7124
  setFullProps(instance, rawProps, props, attrs);
7082
7125
  for (const key in instance.propsOptions[0]) {
@@ -7198,7 +7241,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
7198
7241
  }
7199
7242
  }
7200
7243
  if (hasAttrsChanged) {
7201
- trigger(instance, "set", "$attrs");
7244
+ trigger(instance.attrs, "set", "");
7202
7245
  }
7203
7246
  {
7204
7247
  validateProps(rawProps || {}, props, instance);
@@ -7556,21 +7599,20 @@ const initSlots = (instance, children) => {
7556
7599
  const type = children._;
7557
7600
  if (type) {
7558
7601
  instance.slots = toRaw(children);
7559
- def(children, "_", type);
7602
+ def(instance.slots, "_", type);
7560
7603
  } else {
7561
7604
  normalizeObjectSlots(
7562
7605
  children,
7563
- instance.slots = {},
7606
+ instance.slots = createInternalObject(),
7564
7607
  instance
7565
7608
  );
7566
7609
  }
7567
7610
  } else {
7568
- instance.slots = {};
7611
+ instance.slots = createInternalObject();
7569
7612
  if (children) {
7570
7613
  normalizeVNodeSlots(instance, children);
7571
7614
  }
7572
7615
  }
7573
- def(instance.slots, InternalObjectKey, 1);
7574
7616
  };
7575
7617
  const updateSlots = (instance, children, optimized) => {
7576
7618
  const { vnode, slots } = instance;
@@ -7742,6 +7784,7 @@ function createHydrationFunctions(rendererInternals) {
7742
7784
  }
7743
7785
  };
7744
7786
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
7787
+ optimized = optimized || !!vnode.dynamicChildren;
7745
7788
  const isFragmentStart = isComment(node) && node.data === "[";
7746
7789
  const onMismatch = () => handleMismatch(
7747
7790
  node,
@@ -10261,7 +10304,6 @@ const createVNodeWithArgsTransform = (...args) => {
10261
10304
  ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
10262
10305
  );
10263
10306
  };
10264
- const InternalObjectKey = `__vInternal`;
10265
10307
  const normalizeKey = ({ key }) => key != null ? key : null;
10266
10308
  const normalizeRef = ({
10267
10309
  ref,
@@ -10401,7 +10443,7 @@ Component that was made reactive: `,
10401
10443
  function guardReactiveProps(props) {
10402
10444
  if (!props)
10403
10445
  return null;
10404
- return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
10446
+ return isProxy(props) || isInternalObject(props) ? extend({}, props) : props;
10405
10447
  }
10406
10448
  function cloneVNode(vnode, extraProps, mergeRef = false) {
10407
10449
  const { props, ref, patchFlag, children } = vnode;
@@ -10509,7 +10551,7 @@ function normalizeChildren(vnode, children) {
10509
10551
  } else {
10510
10552
  type = 32;
10511
10553
  const slotFlag = children._;
10512
- if (!slotFlag && !(InternalObjectKey in children)) {
10554
+ if (!slotFlag && !isInternalObject(children)) {
10513
10555
  children._ctx = currentRenderingInstance;
10514
10556
  } else if (slotFlag === 3 && currentRenderingInstance) {
10515
10557
  if (currentRenderingInstance.slots._ === 1) {
@@ -10730,7 +10772,7 @@ function setupStatefulComponent(instance, isSSR) {
10730
10772
  }
10731
10773
  }
10732
10774
  instance.accessCache = /* @__PURE__ */ Object.create(null);
10733
- instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
10775
+ instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
10734
10776
  {
10735
10777
  exposePropsOnRenderContext(instance);
10736
10778
  }
@@ -10874,26 +10916,21 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10874
10916
  }
10875
10917
  }
10876
10918
  }
10877
- function getAttrsProxy(instance) {
10878
- return instance.attrsProxy || (instance.attrsProxy = new Proxy(
10879
- instance.attrs,
10880
- {
10881
- get(target, key) {
10882
- markAttrsAccessed();
10883
- track(instance, "get", "$attrs");
10884
- return target[key];
10885
- },
10886
- set() {
10887
- warn$1(`setupContext.attrs is readonly.`);
10888
- return false;
10889
- },
10890
- deleteProperty() {
10891
- warn$1(`setupContext.attrs is readonly.`);
10892
- return false;
10893
- }
10894
- }
10895
- ));
10896
- }
10919
+ const attrsProxyHandlers = {
10920
+ get(target, key) {
10921
+ markAttrsAccessed();
10922
+ track(target, "get", "");
10923
+ return target[key];
10924
+ },
10925
+ set() {
10926
+ warn$1(`setupContext.attrs is readonly.`);
10927
+ return false;
10928
+ },
10929
+ deleteProperty() {
10930
+ warn$1(`setupContext.attrs is readonly.`);
10931
+ return false;
10932
+ }
10933
+ } ;
10897
10934
  function getSlotsProxy(instance) {
10898
10935
  return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
10899
10936
  get(target, key) {
@@ -10927,9 +10964,10 @@ function createSetupContext(instance) {
10927
10964
  instance.exposed = exposed || {};
10928
10965
  };
10929
10966
  {
10967
+ let attrsProxy;
10930
10968
  return Object.freeze({
10931
10969
  get attrs() {
10932
- return getAttrsProxy(instance);
10970
+ return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
10933
10971
  },
10934
10972
  get slots() {
10935
10973
  return getSlotsProxy(instance);
@@ -11274,7 +11312,7 @@ function isMemoSame(cached, memo) {
11274
11312
  return true;
11275
11313
  }
11276
11314
 
11277
- const version = "3.4.21";
11315
+ const version = "3.4.23";
11278
11316
  const warn = warn$1 ;
11279
11317
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11280
11318
  const devtools = devtools$1 ;
@@ -11744,8 +11782,8 @@ function useCssVars(getter) {
11744
11782
  setVarsOnVNode(instance.subTree, vars);
11745
11783
  updateTeleports(vars);
11746
11784
  };
11747
- watchPostEffect(setVars);
11748
11785
  onMounted(() => {
11786
+ watchPostEffect(setVars);
11749
11787
  const ob = new MutationObserver(setVars);
11750
11788
  ob.observe(instance.subTree.el.parentNode, { childList: true });
11751
11789
  onUnmounted(() => ob.disconnect());
@@ -12011,11 +12049,14 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
12011
12049
  const invokers = el[veiKey] || (el[veiKey] = {});
12012
12050
  const existingInvoker = invokers[rawName];
12013
12051
  if (nextValue && existingInvoker) {
12014
- existingInvoker.value = nextValue;
12052
+ existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
12015
12053
  } else {
12016
12054
  const [name, options] = parseName(rawName);
12017
12055
  if (nextValue) {
12018
- const invoker = invokers[rawName] = createInvoker(nextValue, instance);
12056
+ const invoker = invokers[rawName] = createInvoker(
12057
+ sanitizeEventValue(nextValue, rawName) ,
12058
+ instance
12059
+ );
12019
12060
  addEventListener(el, name, invoker, options);
12020
12061
  } else if (existingInvoker) {
12021
12062
  removeEventListener(el, name, existingInvoker, options);
@@ -12058,6 +12099,16 @@ function createInvoker(initialValue, instance) {
12058
12099
  invoker.attached = getNow();
12059
12100
  return invoker;
12060
12101
  }
12102
+ function sanitizeEventValue(value, propName) {
12103
+ if (isFunction(value) || isArray(value)) {
12104
+ return value;
12105
+ }
12106
+ warn(
12107
+ `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
12108
+ Expected function or array of functions, received type ${typeof value}.`
12109
+ );
12110
+ return NOOP;
12111
+ }
12061
12112
  function patchStopImmediatePropagation(e, value) {
12062
12113
  if (isArray(value)) {
12063
12114
  const originalStop = e.stopImmediatePropagation;
@@ -12065,7 +12116,9 @@ function patchStopImmediatePropagation(e, value) {
12065
12116
  originalStop.call(e);
12066
12117
  e._stopped = true;
12067
12118
  };
12068
- return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
12119
+ return value.map(
12120
+ (fn) => (e2) => !e2._stopped && fn && fn(e2)
12121
+ );
12069
12122
  } else {
12070
12123
  return value;
12071
12124
  }
@@ -12266,7 +12319,7 @@ class VueElement extends BaseClass {
12266
12319
  }
12267
12320
  }
12268
12321
  _setAttr(key) {
12269
- let value = this.getAttribute(key);
12322
+ let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
12270
12323
  const camelKey = camelize(key);
12271
12324
  if (this._numberProps && this._numberProps[camelKey]) {
12272
12325
  value = toNumber(value);
@@ -12438,7 +12491,28 @@ const TransitionGroupImpl = {
12438
12491
  )) {
12439
12492
  tag = "span";
12440
12493
  }
12441
- prevChildren = children;
12494
+ prevChildren = [];
12495
+ if (children) {
12496
+ for (let i = 0; i < children.length; i++) {
12497
+ const child = children[i];
12498
+ if (child.el && child.el instanceof Element) {
12499
+ prevChildren.push(child);
12500
+ setTransitionHooks(
12501
+ child,
12502
+ resolveTransitionHooks(
12503
+ child,
12504
+ cssTransitionProps,
12505
+ state,
12506
+ instance
12507
+ )
12508
+ );
12509
+ positionMap.set(
12510
+ child,
12511
+ child.el.getBoundingClientRect()
12512
+ );
12513
+ }
12514
+ }
12515
+ }
12442
12516
  children = slots.default ? getTransitionRawChildren(slots.default()) : [];
12443
12517
  for (let i = 0; i < children.length; i++) {
12444
12518
  const child = children[i];
@@ -12451,16 +12525,6 @@ const TransitionGroupImpl = {
12451
12525
  warn(`<TransitionGroup> children must be keyed.`);
12452
12526
  }
12453
12527
  }
12454
- if (prevChildren) {
12455
- for (let i = 0; i < prevChildren.length; i++) {
12456
- const child = prevChildren[i];
12457
- setTransitionHooks(
12458
- child,
12459
- resolveTransitionHooks(child, cssTransitionProps, state, instance)
12460
- );
12461
- positionMap.set(child, child.el.getBoundingClientRect());
12462
- }
12463
- }
12464
12528
  return createVNode(tag, null, children);
12465
12529
  };
12466
12530
  }
@@ -12562,7 +12626,7 @@ const vModelText = {
12562
12626
  el[assignKey] = getModelAssigner(vnode);
12563
12627
  if (el.composing)
12564
12628
  return;
12565
- const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
12629
+ const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
12566
12630
  const newValue = value == null ? "" : value;
12567
12631
  if (elValue === newValue) {
12568
12632
  return;
@@ -12665,14 +12729,14 @@ const vModelSelect = {
12665
12729
  // set value in mounted & updated because <select> relies on its children
12666
12730
  // <option>s.
12667
12731
  mounted(el, { value, modifiers: { number } }) {
12668
- setSelected(el, value, number);
12732
+ setSelected(el, value);
12669
12733
  },
12670
12734
  beforeUpdate(el, _binding, vnode) {
12671
12735
  el[assignKey] = getModelAssigner(vnode);
12672
12736
  },
12673
12737
  updated(el, { value, modifiers: { number } }) {
12674
12738
  if (!el._assigning) {
12675
- setSelected(el, value, number);
12739
+ setSelected(el, value);
12676
12740
  }
12677
12741
  }
12678
12742
  };
@@ -12692,9 +12756,7 @@ function setSelected(el, value, number) {
12692
12756
  if (isArrayValue) {
12693
12757
  const optionType = typeof optionValue;
12694
12758
  if (optionType === "string" || optionType === "number") {
12695
- option.selected = value.includes(
12696
- number ? looseToNumber(optionValue) : optionValue
12697
- );
12759
+ option.selected = value.some((v) => String(v) === String(optionValue));
12698
12760
  } else {
12699
12761
  option.selected = looseIndexOf(value, optionValue) > -1;
12700
12762
  }