@vue/runtime-core 3.5.30 → 3.5.31
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-core.cjs.js +50 -18
- package/dist/runtime-core.cjs.prod.js +38 -17
- package/dist/runtime-core.d.ts +21 -0
- package/dist/runtime-core.esm-bundler.js +50 -18
- package/package.json +3 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.31
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -445,6 +445,13 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
445
445
|
}
|
|
446
446
|
|
|
447
447
|
let isHmrUpdating = false;
|
|
448
|
+
const setHmrUpdating = (v) => {
|
|
449
|
+
try {
|
|
450
|
+
return isHmrUpdating;
|
|
451
|
+
} finally {
|
|
452
|
+
isHmrUpdating = v;
|
|
453
|
+
}
|
|
454
|
+
};
|
|
448
455
|
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
449
456
|
{
|
|
450
457
|
shared.getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
@@ -1031,9 +1038,10 @@ const TeleportImpl = {
|
|
|
1031
1038
|
mount(container, mainAnchor);
|
|
1032
1039
|
updateCssVars(n2, true);
|
|
1033
1040
|
}
|
|
1034
|
-
if (isTeleportDeferred(n2.props)) {
|
|
1041
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
1035
1042
|
n2.el.__isMounted = false;
|
|
1036
1043
|
queuePostRenderEffect(() => {
|
|
1044
|
+
if (n2.el.__isMounted !== false) return;
|
|
1037
1045
|
mountToTarget();
|
|
1038
1046
|
delete n2.el.__isMounted;
|
|
1039
1047
|
}, parentSuspense);
|
|
@@ -1041,7 +1049,12 @@ const TeleportImpl = {
|
|
|
1041
1049
|
mountToTarget();
|
|
1042
1050
|
}
|
|
1043
1051
|
} else {
|
|
1044
|
-
|
|
1052
|
+
n2.el = n1.el;
|
|
1053
|
+
n2.targetStart = n1.targetStart;
|
|
1054
|
+
const mainAnchor = n2.anchor = n1.anchor;
|
|
1055
|
+
const target = n2.target = n1.target;
|
|
1056
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
1057
|
+
if (n1.el.__isMounted === false) {
|
|
1045
1058
|
queuePostRenderEffect(() => {
|
|
1046
1059
|
TeleportImpl.process(
|
|
1047
1060
|
n1,
|
|
@@ -1058,11 +1071,6 @@ const TeleportImpl = {
|
|
|
1058
1071
|
}, parentSuspense);
|
|
1059
1072
|
return;
|
|
1060
1073
|
}
|
|
1061
|
-
n2.el = n1.el;
|
|
1062
|
-
n2.targetStart = n1.targetStart;
|
|
1063
|
-
const mainAnchor = n2.anchor = n1.anchor;
|
|
1064
|
-
const target = n2.target = n1.target;
|
|
1065
|
-
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
1066
1074
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
1067
1075
|
const currentContainer = wasDisabled ? container : target;
|
|
1068
1076
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -1525,7 +1533,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1525
1533
|
callHook(hook, [el]);
|
|
1526
1534
|
},
|
|
1527
1535
|
enter(el) {
|
|
1528
|
-
if (leavingVNodesCache[key] === vnode) return;
|
|
1536
|
+
if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
|
|
1529
1537
|
let hook = onEnter;
|
|
1530
1538
|
let afterHook = onAfterEnter;
|
|
1531
1539
|
let cancelHook = onEnterCancelled;
|
|
@@ -4766,11 +4774,12 @@ function hasPropValueChanged(nextProps, prevProps, key) {
|
|
|
4766
4774
|
}
|
|
4767
4775
|
return nextProp !== prevProp;
|
|
4768
4776
|
}
|
|
4769
|
-
function updateHOCHostEl({ vnode, parent }, el) {
|
|
4777
|
+
function updateHOCHostEl({ vnode, parent, suspense }, el) {
|
|
4770
4778
|
while (parent) {
|
|
4771
4779
|
const root = parent.subTree;
|
|
4772
4780
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
4773
|
-
root.el =
|
|
4781
|
+
root.suspense.vnode.el = root.el = el;
|
|
4782
|
+
vnode = root;
|
|
4774
4783
|
}
|
|
4775
4784
|
if (root === vnode) {
|
|
4776
4785
|
(vnode = parent.vnode).el = el;
|
|
@@ -4779,6 +4788,9 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
4779
4788
|
break;
|
|
4780
4789
|
}
|
|
4781
4790
|
}
|
|
4791
|
+
if (suspense && suspense.activeBranch === vnode) {
|
|
4792
|
+
suspense.vnode.el = el;
|
|
4793
|
+
}
|
|
4782
4794
|
}
|
|
4783
4795
|
|
|
4784
4796
|
const internalObjectProto = {};
|
|
@@ -5620,10 +5632,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5620
5632
|
}
|
|
5621
5633
|
hostInsert(el, container, anchor);
|
|
5622
5634
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
5635
|
+
const isHmr = isHmrUpdating;
|
|
5623
5636
|
queuePostRenderEffect(() => {
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5637
|
+
let prev;
|
|
5638
|
+
prev = setHmrUpdating(isHmr);
|
|
5639
|
+
try {
|
|
5640
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5641
|
+
needCallTransitionHooks && transition.enter(el);
|
|
5642
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
5643
|
+
} finally {
|
|
5644
|
+
setHmrUpdating(prev);
|
|
5645
|
+
}
|
|
5627
5646
|
}, parentSuspense);
|
|
5628
5647
|
}
|
|
5629
5648
|
};
|
|
@@ -6544,7 +6563,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6544
6563
|
shapeFlag,
|
|
6545
6564
|
patchFlag,
|
|
6546
6565
|
dirs,
|
|
6547
|
-
cacheIndex
|
|
6566
|
+
cacheIndex,
|
|
6567
|
+
memo
|
|
6548
6568
|
} = vnode;
|
|
6549
6569
|
if (patchFlag === -2) {
|
|
6550
6570
|
optimized = false;
|
|
@@ -6606,10 +6626,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6606
6626
|
remove(vnode);
|
|
6607
6627
|
}
|
|
6608
6628
|
}
|
|
6609
|
-
|
|
6629
|
+
const shouldInvalidateMemo = memo != null && cacheIndex == null;
|
|
6630
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
|
|
6610
6631
|
queuePostRenderEffect(() => {
|
|
6611
6632
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
6612
6633
|
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
6634
|
+
if (shouldInvalidateMemo) {
|
|
6635
|
+
vnode.el = null;
|
|
6636
|
+
}
|
|
6613
6637
|
}, parentSuspense);
|
|
6614
6638
|
}
|
|
6615
6639
|
};
|
|
@@ -7163,6 +7187,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7163
7187
|
pendingId: suspenseId++,
|
|
7164
7188
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
7165
7189
|
activeBranch: null,
|
|
7190
|
+
isFallbackMountPending: false,
|
|
7166
7191
|
pendingBranch: null,
|
|
7167
7192
|
isInFallback: !isHydrating,
|
|
7168
7193
|
isHydrating,
|
|
@@ -7212,7 +7237,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7212
7237
|
}
|
|
7213
7238
|
};
|
|
7214
7239
|
}
|
|
7215
|
-
if (activeBranch) {
|
|
7240
|
+
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
7216
7241
|
if (parentNode(activeBranch.el) === container2) {
|
|
7217
7242
|
anchor = next(activeBranch);
|
|
7218
7243
|
}
|
|
@@ -7225,6 +7250,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7225
7250
|
move(pendingBranch, container2, anchor, 0);
|
|
7226
7251
|
}
|
|
7227
7252
|
}
|
|
7253
|
+
suspense.isFallbackMountPending = false;
|
|
7228
7254
|
setActiveBranch(suspense, pendingBranch);
|
|
7229
7255
|
suspense.pendingBranch = null;
|
|
7230
7256
|
suspense.isInFallback = false;
|
|
@@ -7260,6 +7286,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7260
7286
|
triggerEvent(vnode2, "onFallback");
|
|
7261
7287
|
const anchor2 = next(activeBranch);
|
|
7262
7288
|
const mountFallback = () => {
|
|
7289
|
+
suspense.isFallbackMountPending = false;
|
|
7263
7290
|
if (!suspense.isInFallback) {
|
|
7264
7291
|
return;
|
|
7265
7292
|
}
|
|
@@ -7279,6 +7306,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7279
7306
|
};
|
|
7280
7307
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
7281
7308
|
if (delayEnter) {
|
|
7309
|
+
suspense.isFallbackMountPending = true;
|
|
7282
7310
|
activeBranch.transition.afterLeave = mountFallback;
|
|
7283
7311
|
}
|
|
7284
7312
|
suspense.isInFallback = true;
|
|
@@ -7829,6 +7857,10 @@ function mergeProps(...args) {
|
|
|
7829
7857
|
const incoming = toMerge[key];
|
|
7830
7858
|
if (incoming && existing !== incoming && !(shared.isArray(existing) && existing.includes(incoming))) {
|
|
7831
7859
|
ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
7860
|
+
} else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
|
|
7861
|
+
// the model listener.
|
|
7862
|
+
!shared.isModelListener(key)) {
|
|
7863
|
+
ret[key] = incoming;
|
|
7832
7864
|
}
|
|
7833
7865
|
} else if (key !== "") {
|
|
7834
7866
|
ret[key] = toMerge[key];
|
|
@@ -8513,7 +8545,7 @@ function isMemoSame(cached, memo) {
|
|
|
8513
8545
|
return true;
|
|
8514
8546
|
}
|
|
8515
8547
|
|
|
8516
|
-
const version = "3.5.
|
|
8548
|
+
const version = "3.5.31";
|
|
8517
8549
|
const warn = warn$1 ;
|
|
8518
8550
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8519
8551
|
const devtools = devtools$1 ;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.31
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -584,9 +584,10 @@ const TeleportImpl = {
|
|
|
584
584
|
mount(container, mainAnchor);
|
|
585
585
|
updateCssVars(n2, true);
|
|
586
586
|
}
|
|
587
|
-
if (isTeleportDeferred(n2.props)) {
|
|
587
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
588
588
|
n2.el.__isMounted = false;
|
|
589
589
|
queuePostRenderEffect(() => {
|
|
590
|
+
if (n2.el.__isMounted !== false) return;
|
|
590
591
|
mountToTarget();
|
|
591
592
|
delete n2.el.__isMounted;
|
|
592
593
|
}, parentSuspense);
|
|
@@ -594,7 +595,12 @@ const TeleportImpl = {
|
|
|
594
595
|
mountToTarget();
|
|
595
596
|
}
|
|
596
597
|
} else {
|
|
597
|
-
|
|
598
|
+
n2.el = n1.el;
|
|
599
|
+
n2.targetStart = n1.targetStart;
|
|
600
|
+
const mainAnchor = n2.anchor = n1.anchor;
|
|
601
|
+
const target = n2.target = n1.target;
|
|
602
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
603
|
+
if (n1.el.__isMounted === false) {
|
|
598
604
|
queuePostRenderEffect(() => {
|
|
599
605
|
TeleportImpl.process(
|
|
600
606
|
n1,
|
|
@@ -611,11 +617,6 @@ const TeleportImpl = {
|
|
|
611
617
|
}, parentSuspense);
|
|
612
618
|
return;
|
|
613
619
|
}
|
|
614
|
-
n2.el = n1.el;
|
|
615
|
-
n2.targetStart = n1.targetStart;
|
|
616
|
-
const mainAnchor = n2.anchor = n1.anchor;
|
|
617
|
-
const target = n2.target = n1.target;
|
|
618
|
-
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
619
620
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
620
621
|
const currentContainer = wasDisabled ? container : target;
|
|
621
622
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -3624,11 +3625,12 @@ function hasPropValueChanged(nextProps, prevProps, key) {
|
|
|
3624
3625
|
}
|
|
3625
3626
|
return nextProp !== prevProp;
|
|
3626
3627
|
}
|
|
3627
|
-
function updateHOCHostEl({ vnode, parent }, el) {
|
|
3628
|
+
function updateHOCHostEl({ vnode, parent, suspense }, el) {
|
|
3628
3629
|
while (parent) {
|
|
3629
3630
|
const root = parent.subTree;
|
|
3630
3631
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
3631
|
-
root.el =
|
|
3632
|
+
root.suspense.vnode.el = root.el = el;
|
|
3633
|
+
vnode = root;
|
|
3632
3634
|
}
|
|
3633
3635
|
if (root === vnode) {
|
|
3634
3636
|
(vnode = parent.vnode).el = el;
|
|
@@ -3637,6 +3639,9 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
3637
3639
|
break;
|
|
3638
3640
|
}
|
|
3639
3641
|
}
|
|
3642
|
+
if (suspense && suspense.activeBranch === vnode) {
|
|
3643
|
+
suspense.vnode.el = el;
|
|
3644
|
+
}
|
|
3640
3645
|
}
|
|
3641
3646
|
|
|
3642
3647
|
const internalObjectProto = {};
|
|
@@ -4263,9 +4268,12 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
4263
4268
|
hostInsert(el, container, anchor);
|
|
4264
4269
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
4265
4270
|
queuePostRenderEffect(() => {
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4271
|
+
try {
|
|
4272
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
4273
|
+
needCallTransitionHooks && transition.enter(el);
|
|
4274
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
4275
|
+
} finally {
|
|
4276
|
+
}
|
|
4269
4277
|
}, parentSuspense);
|
|
4270
4278
|
}
|
|
4271
4279
|
};
|
|
@@ -5092,7 +5100,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5092
5100
|
shapeFlag,
|
|
5093
5101
|
patchFlag,
|
|
5094
5102
|
dirs,
|
|
5095
|
-
cacheIndex
|
|
5103
|
+
cacheIndex,
|
|
5104
|
+
memo
|
|
5096
5105
|
} = vnode;
|
|
5097
5106
|
if (patchFlag === -2) {
|
|
5098
5107
|
optimized = false;
|
|
@@ -5154,10 +5163,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5154
5163
|
remove(vnode);
|
|
5155
5164
|
}
|
|
5156
5165
|
}
|
|
5157
|
-
|
|
5166
|
+
const shouldInvalidateMemo = memo != null && cacheIndex == null;
|
|
5167
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
|
|
5158
5168
|
queuePostRenderEffect(() => {
|
|
5159
5169
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5160
5170
|
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
5171
|
+
if (shouldInvalidateMemo) {
|
|
5172
|
+
vnode.el = null;
|
|
5173
|
+
}
|
|
5161
5174
|
}, parentSuspense);
|
|
5162
5175
|
}
|
|
5163
5176
|
};
|
|
@@ -5684,6 +5697,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5684
5697
|
pendingId: suspenseId++,
|
|
5685
5698
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
5686
5699
|
activeBranch: null,
|
|
5700
|
+
isFallbackMountPending: false,
|
|
5687
5701
|
pendingBranch: null,
|
|
5688
5702
|
isInFallback: !isHydrating,
|
|
5689
5703
|
isHydrating,
|
|
@@ -5721,7 +5735,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5721
5735
|
}
|
|
5722
5736
|
};
|
|
5723
5737
|
}
|
|
5724
|
-
if (activeBranch) {
|
|
5738
|
+
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
5725
5739
|
if (parentNode(activeBranch.el) === container2) {
|
|
5726
5740
|
anchor = next(activeBranch);
|
|
5727
5741
|
}
|
|
@@ -5734,6 +5748,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5734
5748
|
move(pendingBranch, container2, anchor, 0);
|
|
5735
5749
|
}
|
|
5736
5750
|
}
|
|
5751
|
+
suspense.isFallbackMountPending = false;
|
|
5737
5752
|
setActiveBranch(suspense, pendingBranch);
|
|
5738
5753
|
suspense.pendingBranch = null;
|
|
5739
5754
|
suspense.isInFallback = false;
|
|
@@ -5769,6 +5784,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5769
5784
|
triggerEvent(vnode2, "onFallback");
|
|
5770
5785
|
const anchor2 = next(activeBranch);
|
|
5771
5786
|
const mountFallback = () => {
|
|
5787
|
+
suspense.isFallbackMountPending = false;
|
|
5772
5788
|
if (!suspense.isInFallback) {
|
|
5773
5789
|
return;
|
|
5774
5790
|
}
|
|
@@ -5788,6 +5804,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
5788
5804
|
};
|
|
5789
5805
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
5790
5806
|
if (delayEnter) {
|
|
5807
|
+
suspense.isFallbackMountPending = true;
|
|
5791
5808
|
activeBranch.transition.afterLeave = mountFallback;
|
|
5792
5809
|
}
|
|
5793
5810
|
suspense.isInFallback = true;
|
|
@@ -6292,6 +6309,10 @@ function mergeProps(...args) {
|
|
|
6292
6309
|
const incoming = toMerge[key];
|
|
6293
6310
|
if (incoming && existing !== incoming && !(shared.isArray(existing) && existing.includes(incoming))) {
|
|
6294
6311
|
ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
6312
|
+
} else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
|
|
6313
|
+
// the model listener.
|
|
6314
|
+
!shared.isModelListener(key)) {
|
|
6315
|
+
ret[key] = incoming;
|
|
6295
6316
|
}
|
|
6296
6317
|
} else if (key !== "") {
|
|
6297
6318
|
ret[key] = toMerge[key];
|
|
@@ -6658,7 +6679,7 @@ function isMemoSame(cached, memo) {
|
|
|
6658
6679
|
return true;
|
|
6659
6680
|
}
|
|
6660
6681
|
|
|
6661
|
-
const version = "3.5.
|
|
6682
|
+
const version = "3.5.31";
|
|
6662
6683
|
const warn$1 = shared.NOOP;
|
|
6663
6684
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6664
6685
|
const devtools = void 0;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -271,6 +271,22 @@ export declare function defineOptions<RawBindings = {}, D = {}, C extends Comput
|
|
|
271
271
|
*/
|
|
272
272
|
slots?: never;
|
|
273
273
|
}): void;
|
|
274
|
+
/**
|
|
275
|
+
* Vue `<script setup>` compiler macro for providing type hints to IDEs for
|
|
276
|
+
* slot name and slot props type checking.
|
|
277
|
+
*
|
|
278
|
+
* Example usage:
|
|
279
|
+
* ```ts
|
|
280
|
+
* const slots = defineSlots<{
|
|
281
|
+
* default(props: { msg: string }): any
|
|
282
|
+
* }>()
|
|
283
|
+
* ```
|
|
284
|
+
*
|
|
285
|
+
* This is only usable inside `<script setup>`, is compiled away in the
|
|
286
|
+
* output and should **not** be actually called at runtime.
|
|
287
|
+
*
|
|
288
|
+
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineslots}
|
|
289
|
+
*/
|
|
274
290
|
export declare function defineSlots<S extends Record<string, any> = Record<string, any>>(): StrictUnwrapSlotsType<SlotsType<S>>;
|
|
275
291
|
export type ModelRef<T, M extends PropertyKey = string, G = T, S = T> = Ref<G, S> & [
|
|
276
292
|
ModelRef<T, M, G, S>,
|
|
@@ -524,6 +540,10 @@ export interface SuspenseProps {
|
|
|
524
540
|
onResolve?: () => void;
|
|
525
541
|
onPending?: () => void;
|
|
526
542
|
onFallback?: () => void;
|
|
543
|
+
/**
|
|
544
|
+
* Switch to fallback content if it takes longer than `timeout` milliseconds to render the new default content.
|
|
545
|
+
* A `timeout` value of `0` will cause the fallback content to be displayed immediately when default content is replaced.
|
|
546
|
+
*/
|
|
527
547
|
timeout?: string | number;
|
|
528
548
|
/**
|
|
529
549
|
* Allow suspense to be captured by parent suspense
|
|
@@ -557,6 +577,7 @@ export interface SuspenseBoundary {
|
|
|
557
577
|
container: RendererElement;
|
|
558
578
|
hiddenContainer: RendererElement;
|
|
559
579
|
activeBranch: VNode | null;
|
|
580
|
+
isFallbackMountPending: boolean;
|
|
560
581
|
pendingBranch: VNode | null;
|
|
561
582
|
deps: number;
|
|
562
583
|
pendingId: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.31
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -448,6 +448,13 @@ function checkRecursiveUpdates(seen, fn) {
|
|
|
448
448
|
}
|
|
449
449
|
|
|
450
450
|
let isHmrUpdating = false;
|
|
451
|
+
const setHmrUpdating = (v) => {
|
|
452
|
+
try {
|
|
453
|
+
return isHmrUpdating;
|
|
454
|
+
} finally {
|
|
455
|
+
isHmrUpdating = v;
|
|
456
|
+
}
|
|
457
|
+
};
|
|
451
458
|
const hmrDirtyComponents = /* @__PURE__ */ new Map();
|
|
452
459
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
453
460
|
getGlobalThis().__VUE_HMR_RUNTIME__ = {
|
|
@@ -1034,9 +1041,10 @@ const TeleportImpl = {
|
|
|
1034
1041
|
mount(container, mainAnchor);
|
|
1035
1042
|
updateCssVars(n2, true);
|
|
1036
1043
|
}
|
|
1037
|
-
if (isTeleportDeferred(n2.props)) {
|
|
1044
|
+
if (isTeleportDeferred(n2.props) || parentSuspense && parentSuspense.pendingBranch) {
|
|
1038
1045
|
n2.el.__isMounted = false;
|
|
1039
1046
|
queuePostRenderEffect(() => {
|
|
1047
|
+
if (n2.el.__isMounted !== false) return;
|
|
1040
1048
|
mountToTarget();
|
|
1041
1049
|
delete n2.el.__isMounted;
|
|
1042
1050
|
}, parentSuspense);
|
|
@@ -1044,7 +1052,12 @@ const TeleportImpl = {
|
|
|
1044
1052
|
mountToTarget();
|
|
1045
1053
|
}
|
|
1046
1054
|
} else {
|
|
1047
|
-
|
|
1055
|
+
n2.el = n1.el;
|
|
1056
|
+
n2.targetStart = n1.targetStart;
|
|
1057
|
+
const mainAnchor = n2.anchor = n1.anchor;
|
|
1058
|
+
const target = n2.target = n1.target;
|
|
1059
|
+
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
1060
|
+
if (n1.el.__isMounted === false) {
|
|
1048
1061
|
queuePostRenderEffect(() => {
|
|
1049
1062
|
TeleportImpl.process(
|
|
1050
1063
|
n1,
|
|
@@ -1061,11 +1074,6 @@ const TeleportImpl = {
|
|
|
1061
1074
|
}, parentSuspense);
|
|
1062
1075
|
return;
|
|
1063
1076
|
}
|
|
1064
|
-
n2.el = n1.el;
|
|
1065
|
-
n2.targetStart = n1.targetStart;
|
|
1066
|
-
const mainAnchor = n2.anchor = n1.anchor;
|
|
1067
|
-
const target = n2.target = n1.target;
|
|
1068
|
-
const targetAnchor = n2.targetAnchor = n1.targetAnchor;
|
|
1069
1077
|
const wasDisabled = isTeleportDisabled(n1.props);
|
|
1070
1078
|
const currentContainer = wasDisabled ? container : target;
|
|
1071
1079
|
const currentAnchor = wasDisabled ? mainAnchor : targetAnchor;
|
|
@@ -1529,7 +1537,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
1529
1537
|
callHook(hook, [el]);
|
|
1530
1538
|
},
|
|
1531
1539
|
enter(el) {
|
|
1532
|
-
if (leavingVNodesCache[key] === vnode) return;
|
|
1540
|
+
if (!isHmrUpdating && leavingVNodesCache[key] === vnode) return;
|
|
1533
1541
|
let hook = onEnter;
|
|
1534
1542
|
let afterHook = onAfterEnter;
|
|
1535
1543
|
let cancelHook = onEnterCancelled;
|
|
@@ -4788,11 +4796,12 @@ function hasPropValueChanged(nextProps, prevProps, key) {
|
|
|
4788
4796
|
}
|
|
4789
4797
|
return nextProp !== prevProp;
|
|
4790
4798
|
}
|
|
4791
|
-
function updateHOCHostEl({ vnode, parent }, el) {
|
|
4799
|
+
function updateHOCHostEl({ vnode, parent, suspense }, el) {
|
|
4792
4800
|
while (parent) {
|
|
4793
4801
|
const root = parent.subTree;
|
|
4794
4802
|
if (root.suspense && root.suspense.activeBranch === vnode) {
|
|
4795
|
-
root.el =
|
|
4803
|
+
root.suspense.vnode.el = root.el = el;
|
|
4804
|
+
vnode = root;
|
|
4796
4805
|
}
|
|
4797
4806
|
if (root === vnode) {
|
|
4798
4807
|
(vnode = parent.vnode).el = el;
|
|
@@ -4801,6 +4810,9 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
4801
4810
|
break;
|
|
4802
4811
|
}
|
|
4803
4812
|
}
|
|
4813
|
+
if (suspense && suspense.activeBranch === vnode) {
|
|
4814
|
+
suspense.vnode.el = el;
|
|
4815
|
+
}
|
|
4804
4816
|
}
|
|
4805
4817
|
|
|
4806
4818
|
const internalObjectProto = {};
|
|
@@ -5669,10 +5681,17 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
5669
5681
|
}
|
|
5670
5682
|
hostInsert(el, container, anchor);
|
|
5671
5683
|
if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) {
|
|
5684
|
+
const isHmr = !!(process.env.NODE_ENV !== "production") && isHmrUpdating;
|
|
5672
5685
|
queuePostRenderEffect(() => {
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5686
|
+
let prev;
|
|
5687
|
+
if (!!(process.env.NODE_ENV !== "production")) prev = setHmrUpdating(isHmr);
|
|
5688
|
+
try {
|
|
5689
|
+
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
5690
|
+
needCallTransitionHooks && transition.enter(el);
|
|
5691
|
+
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
5692
|
+
} finally {
|
|
5693
|
+
if (!!(process.env.NODE_ENV !== "production")) setHmrUpdating(prev);
|
|
5694
|
+
}
|
|
5676
5695
|
}, parentSuspense);
|
|
5677
5696
|
}
|
|
5678
5697
|
};
|
|
@@ -6604,7 +6623,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6604
6623
|
shapeFlag,
|
|
6605
6624
|
patchFlag,
|
|
6606
6625
|
dirs,
|
|
6607
|
-
cacheIndex
|
|
6626
|
+
cacheIndex,
|
|
6627
|
+
memo
|
|
6608
6628
|
} = vnode;
|
|
6609
6629
|
if (patchFlag === -2) {
|
|
6610
6630
|
optimized = false;
|
|
@@ -6666,10 +6686,14 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6666
6686
|
remove(vnode);
|
|
6667
6687
|
}
|
|
6668
6688
|
}
|
|
6669
|
-
|
|
6689
|
+
const shouldInvalidateMemo = memo != null && cacheIndex == null;
|
|
6690
|
+
if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs || shouldInvalidateMemo) {
|
|
6670
6691
|
queuePostRenderEffect(() => {
|
|
6671
6692
|
vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode);
|
|
6672
6693
|
shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted");
|
|
6694
|
+
if (shouldInvalidateMemo) {
|
|
6695
|
+
vnode.el = null;
|
|
6696
|
+
}
|
|
6673
6697
|
}, parentSuspense);
|
|
6674
6698
|
}
|
|
6675
6699
|
};
|
|
@@ -7223,6 +7247,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7223
7247
|
pendingId: suspenseId++,
|
|
7224
7248
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
7225
7249
|
activeBranch: null,
|
|
7250
|
+
isFallbackMountPending: false,
|
|
7226
7251
|
pendingBranch: null,
|
|
7227
7252
|
isInFallback: !isHydrating,
|
|
7228
7253
|
isHydrating,
|
|
@@ -7272,7 +7297,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7272
7297
|
}
|
|
7273
7298
|
};
|
|
7274
7299
|
}
|
|
7275
|
-
if (activeBranch) {
|
|
7300
|
+
if (activeBranch && !suspense.isFallbackMountPending) {
|
|
7276
7301
|
if (parentNode(activeBranch.el) === container2) {
|
|
7277
7302
|
anchor = next(activeBranch);
|
|
7278
7303
|
}
|
|
@@ -7285,6 +7310,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7285
7310
|
move(pendingBranch, container2, anchor, 0);
|
|
7286
7311
|
}
|
|
7287
7312
|
}
|
|
7313
|
+
suspense.isFallbackMountPending = false;
|
|
7288
7314
|
setActiveBranch(suspense, pendingBranch);
|
|
7289
7315
|
suspense.pendingBranch = null;
|
|
7290
7316
|
suspense.isInFallback = false;
|
|
@@ -7320,6 +7346,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7320
7346
|
triggerEvent(vnode2, "onFallback");
|
|
7321
7347
|
const anchor2 = next(activeBranch);
|
|
7322
7348
|
const mountFallback = () => {
|
|
7349
|
+
suspense.isFallbackMountPending = false;
|
|
7323
7350
|
if (!suspense.isInFallback) {
|
|
7324
7351
|
return;
|
|
7325
7352
|
}
|
|
@@ -7339,6 +7366,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
7339
7366
|
};
|
|
7340
7367
|
const delayEnter = fallbackVNode.transition && fallbackVNode.transition.mode === "out-in";
|
|
7341
7368
|
if (delayEnter) {
|
|
7369
|
+
suspense.isFallbackMountPending = true;
|
|
7342
7370
|
activeBranch.transition.afterLeave = mountFallback;
|
|
7343
7371
|
}
|
|
7344
7372
|
suspense.isInFallback = true;
|
|
@@ -7889,6 +7917,10 @@ function mergeProps(...args) {
|
|
|
7889
7917
|
const incoming = toMerge[key];
|
|
7890
7918
|
if (incoming && existing !== incoming && !(isArray(existing) && existing.includes(incoming))) {
|
|
7891
7919
|
ret[key] = existing ? [].concat(existing, incoming) : incoming;
|
|
7920
|
+
} else if (incoming == null && existing == null && // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
|
|
7921
|
+
// the model listener.
|
|
7922
|
+
!isModelListener(key)) {
|
|
7923
|
+
ret[key] = incoming;
|
|
7892
7924
|
}
|
|
7893
7925
|
} else if (key !== "") {
|
|
7894
7926
|
ret[key] = toMerge[key];
|
|
@@ -8587,7 +8619,7 @@ function isMemoSame(cached, memo) {
|
|
|
8587
8619
|
return true;
|
|
8588
8620
|
}
|
|
8589
8621
|
|
|
8590
|
-
const version = "3.5.
|
|
8622
|
+
const version = "3.5.31";
|
|
8591
8623
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
8592
8624
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8593
8625
|
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.31",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@vue/shared": "3.5.
|
|
50
|
-
"@vue/reactivity": "3.5.
|
|
49
|
+
"@vue/shared": "3.5.31",
|
|
50
|
+
"@vue/reactivity": "3.5.31"
|
|
51
51
|
}
|
|
52
52
|
}
|