@vue/runtime-dom 3.5.44 → 3.5.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-dom.cjs.js +7 -7
- package/dist/runtime-dom.cjs.prod.js +7 -7
- package/dist/runtime-dom.d.ts +1 -0
- package/dist/runtime-dom.esm-browser.js +309 -118
- package/dist/runtime-dom.esm-browser.prod.js +4 -4
- package/dist/runtime-dom.esm-bundler.js +7 -7
- package/dist/runtime-dom.global.js +309 -118
- package/dist/runtime-dom.global.prod.js +4 -4
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.5.
|
|
2
|
+
* @vue/runtime-dom v3.5.45
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -61,24 +61,20 @@ const cacheStringFunction = (fn) => {
|
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
63
|
const camelizeRE = /-\w/g;
|
|
64
|
-
const camelize = cacheStringFunction(
|
|
65
|
-
(
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
);
|
|
64
|
+
const camelize = /* @__PURE__ */ cacheStringFunction((str) => {
|
|
65
|
+
return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase());
|
|
66
|
+
});
|
|
69
67
|
const hyphenateRE = /\B([A-Z])/g;
|
|
70
|
-
const hyphenate = cacheStringFunction(
|
|
68
|
+
const hyphenate = /* @__PURE__ */ cacheStringFunction(
|
|
71
69
|
(str) => str.replace(hyphenateRE, "-$1").toLowerCase()
|
|
72
70
|
);
|
|
73
|
-
const capitalize = cacheStringFunction((str) => {
|
|
71
|
+
const capitalize = /* @__PURE__ */ cacheStringFunction((str) => {
|
|
74
72
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
75
73
|
});
|
|
76
|
-
const toHandlerKey = cacheStringFunction(
|
|
77
|
-
(str)
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
);
|
|
74
|
+
const toHandlerKey = /* @__PURE__ */ cacheStringFunction((str) => {
|
|
75
|
+
const s = str ? `on${capitalize(str)}` : ``;
|
|
76
|
+
return s;
|
|
77
|
+
});
|
|
82
78
|
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
83
79
|
const invokeArrayFns = (fns, ...arg) => {
|
|
84
80
|
for (let i = 0; i < fns.length; i++) {
|
|
@@ -191,7 +187,7 @@ const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS);
|
|
|
191
187
|
const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS);
|
|
192
188
|
const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS);
|
|
193
189
|
|
|
194
|
-
const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
190
|
+
const specialBooleanAttrs = `itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly`;
|
|
195
191
|
const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs);
|
|
196
192
|
const isBooleanAttr = /* @__PURE__ */ makeMap(
|
|
197
193
|
specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`
|
|
@@ -535,7 +531,11 @@ function getCurrentScope() {
|
|
|
535
531
|
}
|
|
536
532
|
function onScopeDispose(fn, failSilently = false) {
|
|
537
533
|
if (activeEffectScope) {
|
|
538
|
-
activeEffectScope.
|
|
534
|
+
if (activeEffectScope.active) {
|
|
535
|
+
activeEffectScope.cleanups.push(fn);
|
|
536
|
+
} else {
|
|
537
|
+
fn();
|
|
538
|
+
}
|
|
539
539
|
} else if (!failSilently) {
|
|
540
540
|
warn$2(
|
|
541
541
|
`onScopeDispose() is called when there is no active effect scope to be associated with.`
|
|
@@ -1342,7 +1342,7 @@ function noTracking(self, method, args = []) {
|
|
|
1342
1342
|
}
|
|
1343
1343
|
|
|
1344
1344
|
const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
1345
|
-
const builtInSymbols = new Set(
|
|
1345
|
+
const builtInSymbols = /* @__PURE__ */ new Set(
|
|
1346
1346
|
/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol)
|
|
1347
1347
|
);
|
|
1348
1348
|
function hasOwnProperty(key) {
|
|
@@ -2552,7 +2552,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2552
2552
|
const res = callWithErrorHandling(fn, instance, type, args);
|
|
2553
2553
|
if (res && isPromise(res)) {
|
|
2554
2554
|
res.catch((err) => {
|
|
2555
|
-
handleError(err, instance, type);
|
|
2555
|
+
handleError(err, instance, type, void 0, true);
|
|
2556
2556
|
});
|
|
2557
2557
|
}
|
|
2558
2558
|
return res;
|
|
@@ -2569,7 +2569,7 @@ function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
|
2569
2569
|
);
|
|
2570
2570
|
}
|
|
2571
2571
|
}
|
|
2572
|
-
function handleError(err, instance, type, throwInDev = true) {
|
|
2572
|
+
function handleError(err, instance, type, throwInDev = true, isAsyncError = false) {
|
|
2573
2573
|
const contextVNode = instance ? instance.vnode : null;
|
|
2574
2574
|
const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ;
|
|
2575
2575
|
if (instance) {
|
|
@@ -2578,7 +2578,9 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
2578
2578
|
const errorInfo = ErrorTypeStrings$1[type] ;
|
|
2579
2579
|
while (cur) {
|
|
2580
2580
|
const errorCapturedHooks = cur.ec;
|
|
2581
|
-
if (errorCapturedHooks
|
|
2581
|
+
if (errorCapturedHooks && !cur.isUnmounted && // Async failures may outlive stopped scopes whose unmount effects
|
|
2582
|
+
// are deferred or discarded by Suspense.
|
|
2583
|
+
(!isAsyncError || cur.scope.active)) {
|
|
2582
2584
|
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
2583
2585
|
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
2584
2586
|
return;
|
|
@@ -2906,14 +2908,32 @@ function reload(id, newComp) {
|
|
|
2906
2908
|
instance.ceReload(newComp.styles);
|
|
2907
2909
|
dirtyInstances.delete(instance);
|
|
2908
2910
|
} else if (instance.parent) {
|
|
2909
|
-
|
|
2910
|
-
if (!
|
|
2911
|
-
|
|
2911
|
+
const update = () => {
|
|
2912
|
+
if (!instance.scope.active) return;
|
|
2913
|
+
const pending = instance.asyncDep && !instance.asyncResolved ? instance : locateUnresolvedAsyncRoot(instance.parent);
|
|
2914
|
+
if (pending) {
|
|
2915
|
+
pending.asyncDep.catch(NOOP).then(() => {
|
|
2916
|
+
if (instance.scope.active && (pending.asyncResolved || !pending.scope.active)) {
|
|
2917
|
+
queueJob(update);
|
|
2918
|
+
}
|
|
2919
|
+
});
|
|
2920
|
+
return;
|
|
2921
|
+
}
|
|
2922
|
+
dirtyInstances = hmrDirtyComponents.get(oldComp);
|
|
2923
|
+
if (!dirtyInstances) {
|
|
2924
|
+
hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set());
|
|
2925
|
+
}
|
|
2926
|
+
dirtyInstances.add(instance);
|
|
2927
|
+
isHmrUpdating = true;
|
|
2928
|
+
try {
|
|
2912
2929
|
instance.parent.update();
|
|
2930
|
+
} finally {
|
|
2913
2931
|
isHmrUpdating = false;
|
|
2914
2932
|
dirtyInstances.delete(instance);
|
|
2933
|
+
queuePostFlushCb(() => hmrDirtyComponents.clear());
|
|
2915
2934
|
}
|
|
2916
|
-
}
|
|
2935
|
+
};
|
|
2936
|
+
queueJob(update);
|
|
2917
2937
|
} else if (instance.appContext.reload) {
|
|
2918
2938
|
instance.appContext.reload();
|
|
2919
2939
|
} else if (typeof window !== "undefined") {
|
|
@@ -3129,12 +3149,31 @@ function withDirectives(vnode, directives) {
|
|
|
3129
3149
|
return vnode;
|
|
3130
3150
|
}
|
|
3131
3151
|
function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
3132
|
-
|
|
3152
|
+
let hookVNode = vnode;
|
|
3153
|
+
if (name === "beforeMount") {
|
|
3154
|
+
vnode._mount = vnode;
|
|
3155
|
+
} else if (name === "beforeUpdate") {
|
|
3156
|
+
const mount = prevVNode && prevVNode._mount;
|
|
3157
|
+
if (mount) {
|
|
3158
|
+
mount._latest = vnode;
|
|
3159
|
+
vnode._mount = mount;
|
|
3160
|
+
}
|
|
3161
|
+
} else if (name === "mounted") {
|
|
3162
|
+
const latest = vnode._latest;
|
|
3163
|
+
vnode._mount = vnode._latest = void 0;
|
|
3164
|
+
if (latest) {
|
|
3165
|
+
hookVNode = latest;
|
|
3166
|
+
latest._mount = void 0;
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
const bindings = hookVNode.dirs;
|
|
3133
3170
|
const oldBindings = prevVNode && prevVNode.dirs;
|
|
3134
3171
|
for (let i = 0; i < bindings.length; i++) {
|
|
3135
|
-
|
|
3172
|
+
let binding = bindings[i];
|
|
3136
3173
|
if (oldBindings) {
|
|
3137
3174
|
binding.oldValue = oldBindings[i].value;
|
|
3175
|
+
} else if (name === "mounted" && binding.oldValue !== void 0) {
|
|
3176
|
+
binding = extend({}, binding, { oldValue: void 0 });
|
|
3138
3177
|
}
|
|
3139
3178
|
let hook = binding.dir[name];
|
|
3140
3179
|
if (hook) {
|
|
@@ -3142,7 +3181,7 @@ function invokeDirectiveHook(vnode, prevVNode, instance, name) {
|
|
|
3142
3181
|
callWithAsyncErrorHandling(hook, instance, 8, [
|
|
3143
3182
|
vnode.el,
|
|
3144
3183
|
binding,
|
|
3145
|
-
|
|
3184
|
+
hookVNode,
|
|
3146
3185
|
prevVNode
|
|
3147
3186
|
]);
|
|
3148
3187
|
resetTracking();
|
|
@@ -3766,13 +3805,11 @@ const BaseTransitionImpl = {
|
|
|
3766
3805
|
if (!innerChild) {
|
|
3767
3806
|
return emptyPlaceholder(child);
|
|
3768
3807
|
}
|
|
3769
|
-
|
|
3808
|
+
const enterHooks = resolveTransitionHooks(
|
|
3770
3809
|
innerChild,
|
|
3771
3810
|
rawProps,
|
|
3772
3811
|
state,
|
|
3773
|
-
instance
|
|
3774
|
-
// #11061, ensure enterHooks is fresh after clone
|
|
3775
|
-
(hooks) => enterHooks = hooks
|
|
3812
|
+
instance
|
|
3776
3813
|
);
|
|
3777
3814
|
if (innerChild.type !== Comment) {
|
|
3778
3815
|
setTransitionHooks(innerChild, enterHooks);
|
|
@@ -3791,7 +3828,17 @@ const BaseTransitionImpl = {
|
|
|
3791
3828
|
leavingHooks.afterLeave = () => {
|
|
3792
3829
|
state.isLeaving = false;
|
|
3793
3830
|
if (!(instance.job.flags & 8)) {
|
|
3794
|
-
instance.
|
|
3831
|
+
if (instance.effect.flags & 2) {
|
|
3832
|
+
const job = () => {
|
|
3833
|
+
if (!(instance.job.flags & 8)) {
|
|
3834
|
+
instance.update();
|
|
3835
|
+
}
|
|
3836
|
+
};
|
|
3837
|
+
job.i = instance;
|
|
3838
|
+
queueJob(job);
|
|
3839
|
+
} else {
|
|
3840
|
+
instance.update();
|
|
3841
|
+
}
|
|
3795
3842
|
}
|
|
3796
3843
|
delete leavingHooks.afterLeave;
|
|
3797
3844
|
oldInnerChild = void 0;
|
|
@@ -3855,7 +3902,7 @@ function getLeavingNodesForType(state, vnode) {
|
|
|
3855
3902
|
}
|
|
3856
3903
|
return leavingVNodesCache;
|
|
3857
3904
|
}
|
|
3858
|
-
function resolveTransitionHooks(vnode, props, state, instance
|
|
3905
|
+
function resolveTransitionHooks(vnode, props, state, instance) {
|
|
3859
3906
|
const {
|
|
3860
3907
|
appear,
|
|
3861
3908
|
mode,
|
|
@@ -3994,15 +4041,21 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
3994
4041
|
}
|
|
3995
4042
|
},
|
|
3996
4043
|
clone(vnode2) {
|
|
3997
|
-
const
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
4004
|
-
|
|
4005
|
-
|
|
4044
|
+
const cloned = resolveTransitionHooks(vnode2, props, state, instance);
|
|
4045
|
+
cloned.afterLeave = () => {
|
|
4046
|
+
if (hooks.afterLeave) hooks.afterLeave();
|
|
4047
|
+
};
|
|
4048
|
+
cloned.delayLeave = (el, earlyRemove, delayedLeave) => {
|
|
4049
|
+
if (hooks.delayLeave) {
|
|
4050
|
+
hooks.delayLeave(el, earlyRemove, delayedLeave);
|
|
4051
|
+
} else {
|
|
4052
|
+
delayedLeave();
|
|
4053
|
+
}
|
|
4054
|
+
};
|
|
4055
|
+
cloned.delayedLeave = () => {
|
|
4056
|
+
if (hooks.delayedLeave) hooks.delayedLeave();
|
|
4057
|
+
};
|
|
4058
|
+
return cloned;
|
|
4006
4059
|
}
|
|
4007
4060
|
};
|
|
4008
4061
|
return hooks;
|
|
@@ -4043,8 +4096,16 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
4043
4096
|
hooks
|
|
4044
4097
|
);
|
|
4045
4098
|
} else if (vnode.shapeFlag & 128) {
|
|
4046
|
-
|
|
4047
|
-
|
|
4099
|
+
const suspense = vnode.suspense;
|
|
4100
|
+
if (suspense) {
|
|
4101
|
+
const branch = suspense.isHydrating ? suspense.pendingBranch : suspense.activeBranch;
|
|
4102
|
+
if (branch) {
|
|
4103
|
+
setTransitionHooks(branch, hooks.clone(branch));
|
|
4104
|
+
}
|
|
4105
|
+
} else {
|
|
4106
|
+
vnode.ssContent.transition = hooks.clone(vnode.ssContent);
|
|
4107
|
+
vnode.ssFallback.transition = hooks.clone(vnode.ssFallback);
|
|
4108
|
+
}
|
|
4048
4109
|
} else {
|
|
4049
4110
|
vnode.transition = hooks;
|
|
4050
4111
|
if (vnode.type === Fragment && isArray(vnode.children)) {
|
|
@@ -4745,7 +4806,7 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4745
4806
|
getContainerType(container),
|
|
4746
4807
|
slotScopeIds
|
|
4747
4808
|
);
|
|
4748
|
-
if (parentComponent) {
|
|
4809
|
+
if (parentComponent && parentComponent.vnode.el === node) {
|
|
4749
4810
|
parentComponent.vnode.el = vnode.el;
|
|
4750
4811
|
updateHOCHostEl(parentComponent, vnode.el);
|
|
4751
4812
|
}
|
|
@@ -5179,7 +5240,8 @@ function defineAsyncComponent(source) {
|
|
|
5179
5240
|
err,
|
|
5180
5241
|
instance,
|
|
5181
5242
|
13,
|
|
5182
|
-
!errorComponent
|
|
5243
|
+
!errorComponent,
|
|
5244
|
+
true
|
|
5183
5245
|
);
|
|
5184
5246
|
};
|
|
5185
5247
|
if (suspensible && instance.suspense || isInSSRComponentSetup) {
|
|
@@ -5197,7 +5259,7 @@ function defineAsyncComponent(source) {
|
|
|
5197
5259
|
const delayed = ref(!!delay);
|
|
5198
5260
|
let timeoutTimer;
|
|
5199
5261
|
let delayTimer;
|
|
5200
|
-
|
|
5262
|
+
onScopeDispose(() => {
|
|
5201
5263
|
if (timeoutTimer != null) clearTimeout(timeoutTimer);
|
|
5202
5264
|
if (delayTimer != null) clearTimeout(delayTimer);
|
|
5203
5265
|
});
|
|
@@ -5325,6 +5387,12 @@ const KeepAliveImpl = {
|
|
|
5325
5387
|
}
|
|
5326
5388
|
};
|
|
5327
5389
|
sharedContext.deactivate = (vnode) => {
|
|
5390
|
+
const cached = cache.get(
|
|
5391
|
+
vnode.key == null ? vnode.type : vnode.key
|
|
5392
|
+
);
|
|
5393
|
+
if (!cached || cached.component !== vnode.component) {
|
|
5394
|
+
return false;
|
|
5395
|
+
}
|
|
5328
5396
|
const instance2 = vnode.component;
|
|
5329
5397
|
invalidateMount(instance2.m);
|
|
5330
5398
|
invalidateMount(instance2.a);
|
|
@@ -5345,6 +5413,7 @@ const KeepAliveImpl = {
|
|
|
5345
5413
|
{
|
|
5346
5414
|
instance2.__keepAliveStorageContainer = storageContainer;
|
|
5347
5415
|
}
|
|
5416
|
+
return true;
|
|
5348
5417
|
};
|
|
5349
5418
|
function unmount(vnode) {
|
|
5350
5419
|
resetShapeFlag(vnode);
|
|
@@ -5384,12 +5453,17 @@ const KeepAliveImpl = {
|
|
|
5384
5453
|
const cacheSubtree = () => {
|
|
5385
5454
|
if (pendingCacheKey != null) {
|
|
5386
5455
|
if (isSuspense(instance.subTree.type)) {
|
|
5387
|
-
|
|
5456
|
+
const cacheInnerChild = () => {
|
|
5388
5457
|
const vnode = getInnerChild(instance.subTree);
|
|
5389
5458
|
if (vnode.component) {
|
|
5390
5459
|
cache.set(pendingCacheKey, vnode);
|
|
5391
5460
|
}
|
|
5392
|
-
}
|
|
5461
|
+
};
|
|
5462
|
+
if (instance.subTree.suspense.pendingBranch) {
|
|
5463
|
+
queuePostRenderEffect(cacheInnerChild, instance.subTree.suspense);
|
|
5464
|
+
} else {
|
|
5465
|
+
cacheInnerChild();
|
|
5466
|
+
}
|
|
5393
5467
|
} else {
|
|
5394
5468
|
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
5395
5469
|
}
|
|
@@ -5520,9 +5594,12 @@ function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) {
|
|
|
5520
5594
|
true
|
|
5521
5595
|
/* prepend */
|
|
5522
5596
|
);
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5597
|
+
const removal = injectHook(
|
|
5598
|
+
"um",
|
|
5599
|
+
() => remove(keepAliveRoot[type], injected),
|
|
5600
|
+
target
|
|
5601
|
+
);
|
|
5602
|
+
removal.flags = 16;
|
|
5526
5603
|
}
|
|
5527
5604
|
function resetShapeFlag(vnode) {
|
|
5528
5605
|
vnode.shapeFlag &= -257;
|
|
@@ -8180,6 +8257,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8180
8257
|
const needCallTransitionHooks = needTransition(parentSuspense, transition);
|
|
8181
8258
|
if (needCallTransitionHooks) {
|
|
8182
8259
|
transition.beforeEnter(el);
|
|
8260
|
+
} else if (transition && !transition.persisted) {
|
|
8261
|
+
el[deferredEnterKey] = true;
|
|
8183
8262
|
}
|
|
8184
8263
|
hostInsert(el, container, anchor);
|
|
8185
8264
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
@@ -8662,16 +8741,23 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8662
8741
|
} else {
|
|
8663
8742
|
let { next, bu, u, parent, vnode } = instance;
|
|
8664
8743
|
{
|
|
8665
|
-
const
|
|
8666
|
-
if (
|
|
8744
|
+
const unresolvedAsyncRoot = locateUnresolvedAsyncRoot(instance);
|
|
8745
|
+
if (unresolvedAsyncRoot) {
|
|
8667
8746
|
if (next) {
|
|
8668
8747
|
next.el = vnode.el;
|
|
8669
8748
|
updateComponentPreRender(instance, next, optimized);
|
|
8670
8749
|
}
|
|
8671
|
-
|
|
8672
|
-
|
|
8673
|
-
if (
|
|
8674
|
-
|
|
8750
|
+
unresolvedAsyncRoot.asyncDep.then(() => {
|
|
8751
|
+
const retry = () => {
|
|
8752
|
+
if (instance.job.flags & 8) return;
|
|
8753
|
+
if (parentSuspense && parentSuspense.pendingBranch) {
|
|
8754
|
+
queuePostRenderEffect(retry, parentSuspense);
|
|
8755
|
+
} else {
|
|
8756
|
+
update();
|
|
8757
|
+
}
|
|
8758
|
+
};
|
|
8759
|
+
retry.flags = 16 | 32;
|
|
8760
|
+
queuePostRenderEffect(retry, parentSuspense);
|
|
8675
8761
|
});
|
|
8676
8762
|
return;
|
|
8677
8763
|
}
|
|
@@ -8710,8 +8796,11 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8710
8796
|
patch(
|
|
8711
8797
|
prevTree,
|
|
8712
8798
|
nextTree,
|
|
8713
|
-
// parent may have changed if it's in a teleport
|
|
8714
|
-
|
|
8799
|
+
// parent may have changed if it's in a teleport. a root that is a
|
|
8800
|
+
// pending async component only has its placeholder comment
|
|
8801
|
+
hostParentNode(
|
|
8802
|
+
prevTree.el || resolveAsyncComponentPlaceholder(prevTree)
|
|
8803
|
+
),
|
|
8715
8804
|
// anchor may have changed if it's in a fragment
|
|
8716
8805
|
getNextHostNode(prevTree),
|
|
8717
8806
|
instance,
|
|
@@ -9151,8 +9240,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9151
9240
|
if (cacheIndex != null && (!vnode.ctx || vnode.ctx === parentComponent)) {
|
|
9152
9241
|
parentComponent.renderCache[cacheIndex] = void 0;
|
|
9153
9242
|
}
|
|
9154
|
-
if (shapeFlag & 256) {
|
|
9155
|
-
parentComponent.ctx.deactivate(vnode);
|
|
9243
|
+
if (shapeFlag & 256 && parentComponent.ctx.deactivate(vnode)) {
|
|
9156
9244
|
return;
|
|
9157
9245
|
}
|
|
9158
9246
|
const shouldInvokeDirs = shapeFlag & 1 && dirs;
|
|
@@ -9274,16 +9362,18 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9274
9362
|
if (job) {
|
|
9275
9363
|
job.flags |= 8;
|
|
9276
9364
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
9277
|
-
} else if (
|
|
9365
|
+
} else if (subTree) {
|
|
9278
9366
|
subTree.transition = instance.vnode.transition;
|
|
9279
9367
|
unmount(subTree, instance, parentSuspense, doRemove);
|
|
9280
9368
|
}
|
|
9281
9369
|
if (um) {
|
|
9282
9370
|
queuePostRenderEffect(um, parentSuspense);
|
|
9283
9371
|
}
|
|
9284
|
-
|
|
9372
|
+
const markUnmounted = () => {
|
|
9285
9373
|
instance.isUnmounted = true;
|
|
9286
|
-
}
|
|
9374
|
+
};
|
|
9375
|
+
markUnmounted.flags = 16;
|
|
9376
|
+
queuePostRenderEffect(markUnmounted, parentSuspense);
|
|
9287
9377
|
{
|
|
9288
9378
|
devtoolsComponentRemoved(instance);
|
|
9289
9379
|
}
|
|
@@ -9435,13 +9525,13 @@ function getSequence(arr) {
|
|
|
9435
9525
|
}
|
|
9436
9526
|
return result;
|
|
9437
9527
|
}
|
|
9438
|
-
function
|
|
9528
|
+
function locateUnresolvedAsyncRoot(instance) {
|
|
9439
9529
|
const subComponent = instance.subTree.component;
|
|
9440
9530
|
if (subComponent) {
|
|
9441
9531
|
if (subComponent.asyncDep && !subComponent.asyncResolved) {
|
|
9442
9532
|
return subComponent;
|
|
9443
9533
|
} else {
|
|
9444
|
-
return
|
|
9534
|
+
return locateUnresolvedAsyncRoot(subComponent);
|
|
9445
9535
|
}
|
|
9446
9536
|
}
|
|
9447
9537
|
}
|
|
@@ -9459,11 +9549,16 @@ function resolveAsyncComponentPlaceholder(anchorVnode) {
|
|
|
9459
9549
|
if (instance) {
|
|
9460
9550
|
return resolveAsyncComponentPlaceholder(instance.subTree);
|
|
9461
9551
|
}
|
|
9552
|
+
const suspense = anchorVnode.suspense;
|
|
9553
|
+
if (suspense && suspense.activeBranch) {
|
|
9554
|
+
return resolveAsyncComponentPlaceholder(suspense.activeBranch);
|
|
9555
|
+
}
|
|
9462
9556
|
return null;
|
|
9463
9557
|
}
|
|
9464
9558
|
|
|
9465
9559
|
const isSuspense = (type) => type.__isSuspense;
|
|
9466
9560
|
let suspenseId = 0;
|
|
9561
|
+
const deferredEnterKey = /* @__PURE__ */ Symbol("_deferredEnter");
|
|
9467
9562
|
const SuspenseImpl = {
|
|
9468
9563
|
name: "Suspense",
|
|
9469
9564
|
// In order to make Suspense tree-shakable, we need to avoid importing it
|
|
@@ -9485,11 +9580,22 @@ const SuspenseImpl = {
|
|
|
9485
9580
|
rendererInternals
|
|
9486
9581
|
);
|
|
9487
9582
|
} else {
|
|
9488
|
-
|
|
9489
|
-
|
|
9490
|
-
|
|
9491
|
-
|
|
9492
|
-
|
|
9583
|
+
const suspense = n1.suspense;
|
|
9584
|
+
if (parentSuspense && parentSuspense.deps > 0 && !parentSuspense.isHydrating) {
|
|
9585
|
+
const owner = suspense.parentComponent;
|
|
9586
|
+
const retained = !!owner && owner.suspense === parentSuspense && owner.suspenseId !== parentSuspense.pendingId;
|
|
9587
|
+
if (retained ? (
|
|
9588
|
+
// deps can outlive the pending branch: skip only while it exists
|
|
9589
|
+
parentSuspense.pendingBranch && !isSameVNodeType(
|
|
9590
|
+
n2.ssContent,
|
|
9591
|
+
suspense.pendingBranch || suspense.activeBranch
|
|
9592
|
+
)
|
|
9593
|
+
) : !suspense.isInFallback) {
|
|
9594
|
+
n2.suspense = suspense;
|
|
9595
|
+
suspense.vnode = n2;
|
|
9596
|
+
n2.el = n1.el;
|
|
9597
|
+
return;
|
|
9598
|
+
}
|
|
9493
9599
|
}
|
|
9494
9600
|
patchSuspense(
|
|
9495
9601
|
n1,
|
|
@@ -9514,6 +9620,38 @@ function triggerEvent(vnode, name) {
|
|
|
9514
9620
|
eventListener();
|
|
9515
9621
|
}
|
|
9516
9622
|
}
|
|
9623
|
+
function enterDeferred(branch) {
|
|
9624
|
+
const enters = [];
|
|
9625
|
+
collectDeferredEnters(branch, enters, true);
|
|
9626
|
+
if (enters.length) {
|
|
9627
|
+
queuePostFlushCb(enters);
|
|
9628
|
+
}
|
|
9629
|
+
}
|
|
9630
|
+
function collectDeferredEnters(vnode, enters, isRoot) {
|
|
9631
|
+
const { el, transition, children, shapeFlag } = vnode;
|
|
9632
|
+
if (shapeFlag & 6) {
|
|
9633
|
+
collectDeferredEnters(vnode.component.subTree, enters, isRoot);
|
|
9634
|
+
return;
|
|
9635
|
+
}
|
|
9636
|
+
if (shapeFlag & (128 | 64)) {
|
|
9637
|
+
return;
|
|
9638
|
+
}
|
|
9639
|
+
if (shapeFlag & 1) {
|
|
9640
|
+
if (!isRoot && el && el[deferredEnterKey]) {
|
|
9641
|
+
el[deferredEnterKey] = void 0;
|
|
9642
|
+
if (transition && !transition.persisted) {
|
|
9643
|
+
transition.beforeEnter(el);
|
|
9644
|
+
enters.push(() => transition.enter(el));
|
|
9645
|
+
}
|
|
9646
|
+
}
|
|
9647
|
+
isRoot = false;
|
|
9648
|
+
}
|
|
9649
|
+
if (shapeFlag & 16) {
|
|
9650
|
+
for (let i = 0; i < children.length; i++) {
|
|
9651
|
+
collectDeferredEnters(children[i], enters, isRoot);
|
|
9652
|
+
}
|
|
9653
|
+
}
|
|
9654
|
+
}
|
|
9517
9655
|
function mountSuspense(vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, rendererInternals) {
|
|
9518
9656
|
const {
|
|
9519
9657
|
p: patch,
|
|
@@ -9613,7 +9751,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9613
9751
|
unmount(pendingBranch, parentComponent, suspense);
|
|
9614
9752
|
}
|
|
9615
9753
|
suspense.deps = 0;
|
|
9616
|
-
suspense
|
|
9754
|
+
discardEffects(suspense);
|
|
9617
9755
|
suspense.hiddenContainer = createElement("div");
|
|
9618
9756
|
if (isInFallback) {
|
|
9619
9757
|
patch(
|
|
@@ -9691,11 +9829,7 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9691
9829
|
} else {
|
|
9692
9830
|
triggerEvent(n2, "onPending");
|
|
9693
9831
|
suspense.pendingBranch = newBranch;
|
|
9694
|
-
|
|
9695
|
-
suspense.pendingId = newBranch.component.suspenseId;
|
|
9696
|
-
} else {
|
|
9697
|
-
suspense.pendingId = suspenseId++;
|
|
9698
|
-
}
|
|
9832
|
+
suspense.pendingId = suspenseId++;
|
|
9699
9833
|
patch(
|
|
9700
9834
|
null,
|
|
9701
9835
|
newBranch,
|
|
@@ -9710,12 +9844,11 @@ function patchSuspense(n1, n2, container, anchor, parentComponent, namespace, sl
|
|
|
9710
9844
|
if (suspense.deps <= 0) {
|
|
9711
9845
|
suspense.resolve();
|
|
9712
9846
|
} else {
|
|
9713
|
-
const { timeout
|
|
9847
|
+
const { timeout } = suspense;
|
|
9714
9848
|
if (timeout > 0) {
|
|
9715
|
-
setTimeout(() => {
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
}
|
|
9849
|
+
suspense.timeoutTimer = setTimeout(() => {
|
|
9850
|
+
suspense.timeoutTimer = void 0;
|
|
9851
|
+
suspense.fallback(suspense.vnode.ssFallback);
|
|
9719
9852
|
}, timeout);
|
|
9720
9853
|
} else if (timeout === 0) {
|
|
9721
9854
|
suspense.fallback(newFallback);
|
|
@@ -9762,6 +9895,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9762
9895
|
deps: 0,
|
|
9763
9896
|
pendingId: suspenseId++,
|
|
9764
9897
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
9898
|
+
timeoutTimer: void 0,
|
|
9765
9899
|
activeBranch: null,
|
|
9766
9900
|
isFallbackMountPending: false,
|
|
9767
9901
|
pendingBranch: null,
|
|
@@ -9800,7 +9934,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9800
9934
|
let hasUpdatedAnchor = false;
|
|
9801
9935
|
if (delayEnter) {
|
|
9802
9936
|
activeBranch.transition.afterLeave = () => {
|
|
9803
|
-
if (pendingId === suspense.pendingId) {
|
|
9937
|
+
if (pendingId === suspense.pendingId && !suspense.isUnmounted) {
|
|
9938
|
+
enterDeferred(pendingBranch);
|
|
9804
9939
|
move(
|
|
9805
9940
|
pendingBranch,
|
|
9806
9941
|
container2,
|
|
@@ -9815,7 +9950,9 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9815
9950
|
};
|
|
9816
9951
|
}
|
|
9817
9952
|
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
9818
|
-
if (parentNode(
|
|
9953
|
+
if (parentNode(
|
|
9954
|
+
activeBranch.el || resolveAsyncComponentPlaceholder(activeBranch)
|
|
9955
|
+
) === container2) {
|
|
9819
9956
|
anchor = next(activeBranch);
|
|
9820
9957
|
hasUpdatedAnchor = true;
|
|
9821
9958
|
}
|
|
@@ -9825,13 +9962,26 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9825
9962
|
}
|
|
9826
9963
|
}
|
|
9827
9964
|
if (!delayEnter) {
|
|
9965
|
+
enterDeferred(pendingBranch);
|
|
9828
9966
|
move(pendingBranch, container2, anchor, 0);
|
|
9829
9967
|
}
|
|
9830
9968
|
}
|
|
9969
|
+
clearTimeout(suspense.timeoutTimer);
|
|
9970
|
+
suspense.timeoutTimer = void 0;
|
|
9831
9971
|
suspense.isFallbackMountPending = false;
|
|
9832
9972
|
setActiveBranch(suspense, pendingBranch);
|
|
9833
9973
|
suspense.pendingBranch = null;
|
|
9834
9974
|
suspense.isInFallback = false;
|
|
9975
|
+
let kept = 0;
|
|
9976
|
+
for (let i = 0; i < effects.length; i++) {
|
|
9977
|
+
const effect = effects[i];
|
|
9978
|
+
if (effect.flags & 32) {
|
|
9979
|
+
queuePostFlushCb(effect);
|
|
9980
|
+
} else {
|
|
9981
|
+
effects[kept++] = effect;
|
|
9982
|
+
}
|
|
9983
|
+
}
|
|
9984
|
+
effects.length = kept;
|
|
9835
9985
|
let parent = suspense.parent;
|
|
9836
9986
|
let hasUnresolvedAncestor = false;
|
|
9837
9987
|
while (parent) {
|
|
@@ -9860,7 +10010,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9860
10010
|
triggerEvent(vnode2, "onResolve");
|
|
9861
10011
|
},
|
|
9862
10012
|
fallback(fallbackVNode) {
|
|
9863
|
-
if (!suspense.pendingBranch) {
|
|
10013
|
+
if (suspense.isUnmounted || !suspense.pendingBranch) {
|
|
9864
10014
|
return;
|
|
9865
10015
|
}
|
|
9866
10016
|
const { vnode: vnode2, activeBranch, parentComponent: parentComponent2, container: container2, namespace: namespace2 } = suspense;
|
|
@@ -9868,7 +10018,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9868
10018
|
const anchor2 = next(activeBranch);
|
|
9869
10019
|
const mountFallback = () => {
|
|
9870
10020
|
suspense.isFallbackMountPending = false;
|
|
9871
|
-
if (!suspense.isInFallback) {
|
|
10021
|
+
if (suspense.isUnmounted || !suspense.isInFallback) {
|
|
9872
10022
|
return;
|
|
9873
10023
|
}
|
|
9874
10024
|
const latestFallback = suspense.vnode.ssFallback;
|
|
@@ -9920,19 +10070,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9920
10070
|
suspense.deps++;
|
|
9921
10071
|
}
|
|
9922
10072
|
const hydratedEl = instance.vnode.el;
|
|
9923
|
-
|
|
9924
|
-
handleError(err, instance, 0);
|
|
9925
|
-
}).then((asyncSetupResult) => {
|
|
9926
|
-
if (instance.isUnmounted || suspense.isUnmounted || suspense.pendingId !== instance.suspenseId) {
|
|
9927
|
-
return;
|
|
9928
|
-
}
|
|
9929
|
-
unsetCurrentInstance();
|
|
9930
|
-
if (!instance.scope.active) {
|
|
9931
|
-
if (isInPendingSuspense && --suspense.deps === 0) {
|
|
9932
|
-
suspense.resolve();
|
|
9933
|
-
}
|
|
9934
|
-
return;
|
|
9935
|
-
}
|
|
10073
|
+
const render = (asyncSetupResult) => {
|
|
9936
10074
|
instance.asyncResolved = true;
|
|
9937
10075
|
const { vnode: vnode2 } = instance;
|
|
9938
10076
|
{
|
|
@@ -9965,13 +10103,57 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9965
10103
|
{
|
|
9966
10104
|
popWarningContext();
|
|
9967
10105
|
}
|
|
9968
|
-
|
|
10106
|
+
};
|
|
10107
|
+
instance.asyncDep.catch((err) => {
|
|
10108
|
+
handleError(err, instance, 0, false, true);
|
|
10109
|
+
return () => null;
|
|
10110
|
+
}).then((asyncSetupResult) => {
|
|
10111
|
+
if (instance.isUnmounted || suspense.isUnmounted) {
|
|
10112
|
+
return;
|
|
10113
|
+
}
|
|
10114
|
+
const isPendingDep = isInPendingSuspense && suspense.pendingId === instance.suspenseId;
|
|
10115
|
+
unsetCurrentInstance();
|
|
10116
|
+
if (!instance.scope.active) {
|
|
10117
|
+
if (isPendingDep && --suspense.deps === 0) {
|
|
10118
|
+
suspense.resolve();
|
|
10119
|
+
}
|
|
10120
|
+
return;
|
|
10121
|
+
}
|
|
10122
|
+
if (!isPendingDep && suspense.pendingBranch) {
|
|
10123
|
+
const job = () => {
|
|
10124
|
+
if (instance.isUnmounted || suspense.isUnmounted || !instance.scope.active) {
|
|
10125
|
+
return;
|
|
10126
|
+
}
|
|
10127
|
+
if (suspense.pendingBranch) {
|
|
10128
|
+
queueEffectWithSuspense(job, suspense);
|
|
10129
|
+
} else {
|
|
10130
|
+
render(asyncSetupResult);
|
|
10131
|
+
}
|
|
10132
|
+
};
|
|
10133
|
+
job.flags = 16 | 32;
|
|
10134
|
+
queueEffectWithSuspense(job, suspense);
|
|
10135
|
+
return;
|
|
10136
|
+
}
|
|
10137
|
+
render(asyncSetupResult);
|
|
10138
|
+
if (isPendingDep && --suspense.deps === 0) {
|
|
9969
10139
|
suspense.resolve();
|
|
9970
10140
|
}
|
|
9971
10141
|
});
|
|
9972
10142
|
},
|
|
9973
10143
|
unmount(parentSuspense2, doRemove) {
|
|
9974
10144
|
suspense.isUnmounted = true;
|
|
10145
|
+
clearTimeout(suspense.timeoutTimer);
|
|
10146
|
+
suspense.timeoutTimer = void 0;
|
|
10147
|
+
if (parentSuspenseId !== void 0) {
|
|
10148
|
+
const parent = suspense.parent;
|
|
10149
|
+
const pendingId = parentSuspenseId;
|
|
10150
|
+
parentSuspenseId = void 0;
|
|
10151
|
+
queuePostFlushCb(() => {
|
|
10152
|
+
if (parent.pendingId === pendingId && !parent.isUnmounted && --parent.deps === 0) {
|
|
10153
|
+
parent.resolve();
|
|
10154
|
+
}
|
|
10155
|
+
});
|
|
10156
|
+
}
|
|
9975
10157
|
if (suspense.activeBranch) {
|
|
9976
10158
|
unmount(
|
|
9977
10159
|
suspense.activeBranch,
|
|
@@ -9981,12 +10163,8 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
9981
10163
|
);
|
|
9982
10164
|
}
|
|
9983
10165
|
if (suspense.pendingBranch) {
|
|
9984
|
-
unmount(
|
|
9985
|
-
|
|
9986
|
-
parentComponent,
|
|
9987
|
-
parentSuspense2,
|
|
9988
|
-
doRemove
|
|
9989
|
-
);
|
|
10166
|
+
unmount(suspense.pendingBranch, parentComponent, suspense, doRemove);
|
|
10167
|
+
discardEffects(suspense);
|
|
9990
10168
|
}
|
|
9991
10169
|
}
|
|
9992
10170
|
};
|
|
@@ -10056,6 +10234,16 @@ function normalizeSuspenseSlot(s) {
|
|
|
10056
10234
|
}
|
|
10057
10235
|
return s;
|
|
10058
10236
|
}
|
|
10237
|
+
function discardEffects(suspense) {
|
|
10238
|
+
const { effects } = suspense;
|
|
10239
|
+
for (let i = 0; i < effects.length; i++) {
|
|
10240
|
+
const effect = effects[i];
|
|
10241
|
+
if (effect.flags & 16) {
|
|
10242
|
+
queuePostFlushCb(effect);
|
|
10243
|
+
}
|
|
10244
|
+
}
|
|
10245
|
+
effects.length = 0;
|
|
10246
|
+
}
|
|
10059
10247
|
function queueEffectWithSuspense(fn, suspense) {
|
|
10060
10248
|
if (suspense && suspense.pendingBranch) {
|
|
10061
10249
|
if (isArray(fn)) {
|
|
@@ -10307,7 +10495,8 @@ Component that was made reactive: `,
|
|
|
10307
10495
|
}
|
|
10308
10496
|
function guardReactiveProps(props) {
|
|
10309
10497
|
if (!props) return null;
|
|
10310
|
-
|
|
10498
|
+
if (isProxy(props)) return extend({}, props);
|
|
10499
|
+
return isInternalObject(props) ? extend({}, props[rawAttrsKey] || props) : props;
|
|
10311
10500
|
}
|
|
10312
10501
|
function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) {
|
|
10313
10502
|
const { props, ref, patchFlag, children, transition } = vnode;
|
|
@@ -10486,7 +10675,7 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
10486
10675
|
]);
|
|
10487
10676
|
}
|
|
10488
10677
|
|
|
10489
|
-
const emptyAppContext = createAppContext();
|
|
10678
|
+
const emptyAppContext = /* @__PURE__ */ createAppContext();
|
|
10490
10679
|
let uid = 0;
|
|
10491
10680
|
function getNextUid() {
|
|
10492
10681
|
return uid;
|
|
@@ -10699,7 +10888,8 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10699
10888
|
setInSSRSetupState(false);
|
|
10700
10889
|
}
|
|
10701
10890
|
}).catch((e) => {
|
|
10702
|
-
handleError(e, instance, 0);
|
|
10891
|
+
handleError(e, instance, 0, void 0, true);
|
|
10892
|
+
instance.ssrRender = (_, push) => push("<!---->");
|
|
10703
10893
|
});
|
|
10704
10894
|
} else {
|
|
10705
10895
|
instance.asyncDep = setupResult;
|
|
@@ -10807,11 +10997,12 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
10807
10997
|
}
|
|
10808
10998
|
}
|
|
10809
10999
|
}
|
|
11000
|
+
const rawAttrsKey = /* @__PURE__ */ Symbol();
|
|
10810
11001
|
const attrsProxyHandlers = {
|
|
10811
11002
|
get(target, key) {
|
|
10812
11003
|
markAttrsAccessed();
|
|
10813
11004
|
track(target, "get", "");
|
|
10814
|
-
return target[key];
|
|
11005
|
+
return key === rawAttrsKey ? target : target[key];
|
|
10815
11006
|
},
|
|
10816
11007
|
set() {
|
|
10817
11008
|
warn$1(`setupContext.attrs is readonly.`);
|
|
@@ -11163,7 +11354,7 @@ function isMemoSame(cached, memo) {
|
|
|
11163
11354
|
return true;
|
|
11164
11355
|
}
|
|
11165
11356
|
|
|
11166
|
-
const version = "3.5.
|
|
11357
|
+
const version = "3.5.45";
|
|
11167
11358
|
const warn = warn$1 ;
|
|
11168
11359
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
11169
11360
|
const devtools = devtools$1 ;
|
|
@@ -12968,18 +13159,18 @@ const vModelSelect = {
|
|
|
12968
13159
|
},
|
|
12969
13160
|
// set value in mounted & updated because <select> relies on its children
|
|
12970
13161
|
// <option>s.
|
|
12971
|
-
mounted(el, { value }) {
|
|
12972
|
-
setSelected(el, value);
|
|
13162
|
+
mounted(el, { value, modifiers: { number } }) {
|
|
13163
|
+
setSelected(el, value, number);
|
|
12973
13164
|
},
|
|
12974
13165
|
beforeUpdate(el, { value }, vnode) {
|
|
12975
13166
|
el._modelValue = value;
|
|
12976
13167
|
el[assignKey] = getModelAssigner(vnode);
|
|
12977
13168
|
},
|
|
12978
|
-
updated(el, { value }) {
|
|
13169
|
+
updated(el, { value, modifiers: { number } }) {
|
|
12979
13170
|
const pending = el._pendingValue;
|
|
12980
13171
|
el._pendingValue = void 0;
|
|
12981
13172
|
if (!pending || pending[0] !== el.multiple || !isSameSelectValue(value, pending[1], pending[0])) {
|
|
12982
|
-
setSelected(el, value);
|
|
13173
|
+
setSelected(el, value, number);
|
|
12983
13174
|
}
|
|
12984
13175
|
}
|
|
12985
13176
|
};
|
|
@@ -12995,7 +13186,7 @@ function isSameSelectValue(value, assignedValue, multiple) {
|
|
|
12995
13186
|
}
|
|
12996
13187
|
return false;
|
|
12997
13188
|
}
|
|
12998
|
-
function setSelected(el, value) {
|
|
13189
|
+
function setSelected(el, value, number = false) {
|
|
12999
13190
|
const isMultiple = el.multiple;
|
|
13000
13191
|
const isArrayValue = isArray(value);
|
|
13001
13192
|
if (isMultiple && !isArrayValue && !isSet(value)) {
|
|
@@ -13016,7 +13207,7 @@ function setSelected(el, value) {
|
|
|
13016
13207
|
option.selected = looseIndexOf(value, optionValue) > -1;
|
|
13017
13208
|
}
|
|
13018
13209
|
} else {
|
|
13019
|
-
option.selected = value.has(optionValue);
|
|
13210
|
+
option.selected = value.has(optionValue) || number && typeof optionValue === "string" && value.has(looseToNumber(optionValue));
|
|
13020
13211
|
}
|
|
13021
13212
|
} else if (looseEqual(getValue(option), value)) {
|
|
13022
13213
|
if (el.selectedIndex !== i) el.selectedIndex = i;
|