@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"];
@@ -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;
@@ -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.22"}`;
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,10 @@ function shouldSkipAttr(key, instance) {
7073
7113
  return false;
7074
7114
  }
7075
7115
 
7116
+ const attrsProto = {};
7076
7117
  function initProps(instance, rawProps, isStateful, isSSR = false) {
7077
7118
  const props = {};
7078
- const attrs = {};
7079
- def(attrs, InternalObjectKey, 1);
7119
+ const attrs = Object.create(attrsProto);
7080
7120
  instance.propsDefaults = /* @__PURE__ */ Object.create(null);
7081
7121
  setFullProps(instance, rawProps, props, attrs);
7082
7122
  for (const key in instance.propsOptions[0]) {
@@ -7198,7 +7238,7 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
7198
7238
  }
7199
7239
  }
7200
7240
  if (hasAttrsChanged) {
7201
- trigger(instance, "set", "$attrs");
7241
+ trigger(instance.attrs, "set", "");
7202
7242
  }
7203
7243
  {
7204
7244
  validateProps(rawProps || {}, props, instance);
@@ -7556,7 +7596,7 @@ const initSlots = (instance, children) => {
7556
7596
  const type = children._;
7557
7597
  if (type) {
7558
7598
  instance.slots = toRaw(children);
7559
- def(children, "_", type);
7599
+ def(instance.slots, "_", type);
7560
7600
  } else {
7561
7601
  normalizeObjectSlots(
7562
7602
  children,
@@ -7570,7 +7610,6 @@ const initSlots = (instance, children) => {
7570
7610
  normalizeVNodeSlots(instance, children);
7571
7611
  }
7572
7612
  }
7573
- def(instance.slots, InternalObjectKey, 1);
7574
7613
  };
7575
7614
  const updateSlots = (instance, children, optimized) => {
7576
7615
  const { vnode, slots } = instance;
@@ -7742,6 +7781,7 @@ function createHydrationFunctions(rendererInternals) {
7742
7781
  }
7743
7782
  };
7744
7783
  const hydrateNode = (node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized = false) => {
7784
+ optimized = optimized || !!vnode.dynamicChildren;
7745
7785
  const isFragmentStart = isComment(node) && node.data === "[";
7746
7786
  const onMismatch = () => handleMismatch(
7747
7787
  node,
@@ -10261,7 +10301,6 @@ const createVNodeWithArgsTransform = (...args) => {
10261
10301
  ...vnodeArgsTransformer ? vnodeArgsTransformer(args, currentRenderingInstance) : args
10262
10302
  );
10263
10303
  };
10264
- const InternalObjectKey = `__vInternal`;
10265
10304
  const normalizeKey = ({ key }) => key != null ? key : null;
10266
10305
  const normalizeRef = ({
10267
10306
  ref,
@@ -10401,7 +10440,7 @@ Component that was made reactive: `,
10401
10440
  function guardReactiveProps(props) {
10402
10441
  if (!props)
10403
10442
  return null;
10404
- return isProxy(props) || InternalObjectKey in props ? extend({}, props) : props;
10443
+ return isProxy(props) || Object.getPrototypeOf(props) === attrsProto ? extend({}, props) : props;
10405
10444
  }
10406
10445
  function cloneVNode(vnode, extraProps, mergeRef = false) {
10407
10446
  const { props, ref, patchFlag, children } = vnode;
@@ -10509,7 +10548,7 @@ function normalizeChildren(vnode, children) {
10509
10548
  } else {
10510
10549
  type = 32;
10511
10550
  const slotFlag = children._;
10512
- if (!slotFlag && !(InternalObjectKey in children)) {
10551
+ if (!slotFlag) {
10513
10552
  children._ctx = currentRenderingInstance;
10514
10553
  } else if (slotFlag === 3 && currentRenderingInstance) {
10515
10554
  if (currentRenderingInstance.slots._ === 1) {
@@ -10730,7 +10769,7 @@ function setupStatefulComponent(instance, isSSR) {
10730
10769
  }
10731
10770
  }
10732
10771
  instance.accessCache = /* @__PURE__ */ Object.create(null);
10733
- instance.proxy = markRaw(new Proxy(instance.ctx, PublicInstanceProxyHandlers));
10772
+ instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
10734
10773
  {
10735
10774
  exposePropsOnRenderContext(instance);
10736
10775
  }
@@ -10874,26 +10913,21 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
10874
10913
  }
10875
10914
  }
10876
10915
  }
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
- }
10916
+ const attrsProxyHandlers = {
10917
+ get(target, key) {
10918
+ markAttrsAccessed();
10919
+ track(target, "get", "");
10920
+ return target[key];
10921
+ },
10922
+ set() {
10923
+ warn$1(`setupContext.attrs is readonly.`);
10924
+ return false;
10925
+ },
10926
+ deleteProperty() {
10927
+ warn$1(`setupContext.attrs is readonly.`);
10928
+ return false;
10929
+ }
10930
+ } ;
10897
10931
  function getSlotsProxy(instance) {
10898
10932
  return instance.slotsProxy || (instance.slotsProxy = new Proxy(instance.slots, {
10899
10933
  get(target, key) {
@@ -10927,9 +10961,10 @@ function createSetupContext(instance) {
10927
10961
  instance.exposed = exposed || {};
10928
10962
  };
10929
10963
  {
10964
+ let attrsProxy;
10930
10965
  return Object.freeze({
10931
10966
  get attrs() {
10932
- return getAttrsProxy(instance);
10967
+ return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers));
10933
10968
  },
10934
10969
  get slots() {
10935
10970
  return getSlotsProxy(instance);
@@ -11274,7 +11309,7 @@ function isMemoSame(cached, memo) {
11274
11309
  return true;
11275
11310
  }
11276
11311
 
11277
- const version = "3.4.21";
11312
+ const version = "3.4.22";
11278
11313
  const warn = warn$1 ;
11279
11314
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11280
11315
  const devtools = devtools$1 ;
@@ -11744,8 +11779,8 @@ function useCssVars(getter) {
11744
11779
  setVarsOnVNode(instance.subTree, vars);
11745
11780
  updateTeleports(vars);
11746
11781
  };
11747
- watchPostEffect(setVars);
11748
11782
  onMounted(() => {
11783
+ watchPostEffect(setVars);
11749
11784
  const ob = new MutationObserver(setVars);
11750
11785
  ob.observe(instance.subTree.el.parentNode, { childList: true });
11751
11786
  onUnmounted(() => ob.disconnect());
@@ -12011,11 +12046,14 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
12011
12046
  const invokers = el[veiKey] || (el[veiKey] = {});
12012
12047
  const existingInvoker = invokers[rawName];
12013
12048
  if (nextValue && existingInvoker) {
12014
- existingInvoker.value = nextValue;
12049
+ existingInvoker.value = sanitizeEventValue(nextValue, rawName) ;
12015
12050
  } else {
12016
12051
  const [name, options] = parseName(rawName);
12017
12052
  if (nextValue) {
12018
- const invoker = invokers[rawName] = createInvoker(nextValue, instance);
12053
+ const invoker = invokers[rawName] = createInvoker(
12054
+ sanitizeEventValue(nextValue, rawName) ,
12055
+ instance
12056
+ );
12019
12057
  addEventListener(el, name, invoker, options);
12020
12058
  } else if (existingInvoker) {
12021
12059
  removeEventListener(el, name, existingInvoker, options);
@@ -12058,6 +12096,16 @@ function createInvoker(initialValue, instance) {
12058
12096
  invoker.attached = getNow();
12059
12097
  return invoker;
12060
12098
  }
12099
+ function sanitizeEventValue(value, propName) {
12100
+ if (isFunction(value) || isArray(value)) {
12101
+ return value;
12102
+ }
12103
+ warn(
12104
+ `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop?
12105
+ Expected function or array of functions, received type ${typeof value}.`
12106
+ );
12107
+ return NOOP;
12108
+ }
12061
12109
  function patchStopImmediatePropagation(e, value) {
12062
12110
  if (isArray(value)) {
12063
12111
  const originalStop = e.stopImmediatePropagation;
@@ -12065,7 +12113,9 @@ function patchStopImmediatePropagation(e, value) {
12065
12113
  originalStop.call(e);
12066
12114
  e._stopped = true;
12067
12115
  };
12068
- return value.map((fn) => (e2) => !e2._stopped && fn && fn(e2));
12116
+ return value.map(
12117
+ (fn) => (e2) => !e2._stopped && fn && fn(e2)
12118
+ );
12069
12119
  } else {
12070
12120
  return value;
12071
12121
  }
@@ -12266,7 +12316,7 @@ class VueElement extends BaseClass {
12266
12316
  }
12267
12317
  }
12268
12318
  _setAttr(key) {
12269
- let value = this.getAttribute(key);
12319
+ let value = this.hasAttribute(key) ? this.getAttribute(key) : void 0;
12270
12320
  const camelKey = camelize(key);
12271
12321
  if (this._numberProps && this._numberProps[camelKey]) {
12272
12322
  value = toNumber(value);
@@ -12438,7 +12488,28 @@ const TransitionGroupImpl = {
12438
12488
  )) {
12439
12489
  tag = "span";
12440
12490
  }
12441
- prevChildren = children;
12491
+ prevChildren = [];
12492
+ if (children) {
12493
+ for (let i = 0; i < children.length; i++) {
12494
+ const child = children[i];
12495
+ if (child.el && child.el instanceof Element) {
12496
+ prevChildren.push(child);
12497
+ setTransitionHooks(
12498
+ child,
12499
+ resolveTransitionHooks(
12500
+ child,
12501
+ cssTransitionProps,
12502
+ state,
12503
+ instance
12504
+ )
12505
+ );
12506
+ positionMap.set(
12507
+ child,
12508
+ child.el.getBoundingClientRect()
12509
+ );
12510
+ }
12511
+ }
12512
+ }
12442
12513
  children = slots.default ? getTransitionRawChildren(slots.default()) : [];
12443
12514
  for (let i = 0; i < children.length; i++) {
12444
12515
  const child = children[i];
@@ -12451,16 +12522,6 @@ const TransitionGroupImpl = {
12451
12522
  warn(`<TransitionGroup> children must be keyed.`);
12452
12523
  }
12453
12524
  }
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
12525
  return createVNode(tag, null, children);
12465
12526
  };
12466
12527
  }
@@ -12562,7 +12623,7 @@ const vModelText = {
12562
12623
  el[assignKey] = getModelAssigner(vnode);
12563
12624
  if (el.composing)
12564
12625
  return;
12565
- const elValue = number || el.type === "number" ? looseToNumber(el.value) : el.value;
12626
+ const elValue = (number || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value;
12566
12627
  const newValue = value == null ? "" : value;
12567
12628
  if (elValue === newValue) {
12568
12629
  return;
@@ -12665,14 +12726,14 @@ const vModelSelect = {
12665
12726
  // set value in mounted & updated because <select> relies on its children
12666
12727
  // <option>s.
12667
12728
  mounted(el, { value, modifiers: { number } }) {
12668
- setSelected(el, value, number);
12729
+ setSelected(el, value);
12669
12730
  },
12670
12731
  beforeUpdate(el, _binding, vnode) {
12671
12732
  el[assignKey] = getModelAssigner(vnode);
12672
12733
  },
12673
12734
  updated(el, { value, modifiers: { number } }) {
12674
12735
  if (!el._assigning) {
12675
- setSelected(el, value, number);
12736
+ setSelected(el, value);
12676
12737
  }
12677
12738
  }
12678
12739
  };
@@ -12692,9 +12753,7 @@ function setSelected(el, value, number) {
12692
12753
  if (isArrayValue) {
12693
12754
  const optionType = typeof optionValue;
12694
12755
  if (optionType === "string" || optionType === "number") {
12695
- option.selected = value.includes(
12696
- number ? looseToNumber(optionValue) : optionValue
12697
- );
12756
+ option.selected = value.some((v) => String(v) === String(optionValue));
12698
12757
  } else {
12699
12758
  option.selected = looseIndexOf(value, optionValue) > -1;
12700
12759
  }