@vue/runtime-core 3.5.11 → 3.5.13
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 +105 -37
- package/dist/runtime-core.cjs.prod.js +91 -31
- package/dist/runtime-core.d.ts +6 -6
- package/dist/runtime-core.esm-bundler.js +107 -39
- 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.13
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -841,7 +841,7 @@ const TeleportImpl = {
|
|
|
841
841
|
}
|
|
842
842
|
if (!disabled) {
|
|
843
843
|
mount(target, targetAnchor);
|
|
844
|
-
updateCssVars(n2);
|
|
844
|
+
updateCssVars(n2, false);
|
|
845
845
|
}
|
|
846
846
|
} else if (!disabled) {
|
|
847
847
|
warn$1(
|
|
@@ -853,14 +853,35 @@ const TeleportImpl = {
|
|
|
853
853
|
};
|
|
854
854
|
if (disabled) {
|
|
855
855
|
mount(container, mainAnchor);
|
|
856
|
-
updateCssVars(n2);
|
|
856
|
+
updateCssVars(n2, true);
|
|
857
857
|
}
|
|
858
858
|
if (isTeleportDeferred(n2.props)) {
|
|
859
|
-
queuePostRenderEffect(
|
|
859
|
+
queuePostRenderEffect(() => {
|
|
860
|
+
mountToTarget();
|
|
861
|
+
n2.el.__isMounted = true;
|
|
862
|
+
}, parentSuspense);
|
|
860
863
|
} else {
|
|
861
864
|
mountToTarget();
|
|
862
865
|
}
|
|
863
866
|
} else {
|
|
867
|
+
if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
|
|
868
|
+
queuePostRenderEffect(() => {
|
|
869
|
+
TeleportImpl.process(
|
|
870
|
+
n1,
|
|
871
|
+
n2,
|
|
872
|
+
container,
|
|
873
|
+
anchor,
|
|
874
|
+
parentComponent,
|
|
875
|
+
parentSuspense,
|
|
876
|
+
namespace,
|
|
877
|
+
slotScopeIds,
|
|
878
|
+
optimized,
|
|
879
|
+
internals
|
|
880
|
+
);
|
|
881
|
+
delete n1.el.__isMounted;
|
|
882
|
+
}, parentSuspense);
|
|
883
|
+
return;
|
|
884
|
+
}
|
|
864
885
|
n2.el = n1.el;
|
|
865
886
|
n2.targetStart = n1.targetStart;
|
|
866
887
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
@@ -943,7 +964,7 @@ const TeleportImpl = {
|
|
|
943
964
|
);
|
|
944
965
|
}
|
|
945
966
|
}
|
|
946
|
-
updateCssVars(n2);
|
|
967
|
+
updateCssVars(n2, disabled);
|
|
947
968
|
}
|
|
948
969
|
},
|
|
949
970
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
@@ -1011,9 +1032,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
1011
1032
|
querySelector
|
|
1012
1033
|
);
|
|
1013
1034
|
if (target) {
|
|
1035
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
1014
1036
|
const targetNode = target._lpa || target.firstChild;
|
|
1015
1037
|
if (vnode.shapeFlag & 16) {
|
|
1016
|
-
if (
|
|
1038
|
+
if (disabled) {
|
|
1017
1039
|
vnode.anchor = hydrateChildren(
|
|
1018
1040
|
nextSibling(node),
|
|
1019
1041
|
vnode,
|
|
@@ -1054,16 +1076,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
1054
1076
|
);
|
|
1055
1077
|
}
|
|
1056
1078
|
}
|
|
1057
|
-
updateCssVars(vnode);
|
|
1079
|
+
updateCssVars(vnode, disabled);
|
|
1058
1080
|
}
|
|
1059
1081
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
1060
1082
|
}
|
|
1061
1083
|
const Teleport = TeleportImpl;
|
|
1062
|
-
function updateCssVars(vnode) {
|
|
1084
|
+
function updateCssVars(vnode, isDisabled) {
|
|
1063
1085
|
const ctx = vnode.ctx;
|
|
1064
1086
|
if (ctx && ctx.ut) {
|
|
1065
|
-
let node
|
|
1066
|
-
|
|
1087
|
+
let node, anchor;
|
|
1088
|
+
if (isDisabled) {
|
|
1089
|
+
node = vnode.el;
|
|
1090
|
+
anchor = vnode.anchor;
|
|
1091
|
+
} else {
|
|
1092
|
+
node = vnode.targetStart;
|
|
1093
|
+
anchor = vnode.targetAnchor;
|
|
1094
|
+
}
|
|
1095
|
+
while (node && node !== anchor) {
|
|
1067
1096
|
if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
|
|
1068
1097
|
node = node.nextSibling;
|
|
1069
1098
|
}
|
|
@@ -1158,10 +1187,9 @@ const BaseTransitionImpl = {
|
|
|
1158
1187
|
if (innerChild.type !== Comment) {
|
|
1159
1188
|
setTransitionHooks(innerChild, enterHooks);
|
|
1160
1189
|
}
|
|
1161
|
-
|
|
1162
|
-
const oldInnerChild = oldChild && getInnerChild$1(oldChild);
|
|
1190
|
+
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
1163
1191
|
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
1164
|
-
|
|
1192
|
+
let leavingHooks = resolveTransitionHooks(
|
|
1165
1193
|
oldInnerChild,
|
|
1166
1194
|
rawProps,
|
|
1167
1195
|
state,
|
|
@@ -1176,6 +1204,7 @@ const BaseTransitionImpl = {
|
|
|
1176
1204
|
instance.update();
|
|
1177
1205
|
}
|
|
1178
1206
|
delete leavingHooks.afterLeave;
|
|
1207
|
+
oldInnerChild = void 0;
|
|
1179
1208
|
};
|
|
1180
1209
|
return emptyPlaceholder(child);
|
|
1181
1210
|
} else if (mode === "in-out" && innerChild.type !== Comment) {
|
|
@@ -1189,10 +1218,19 @@ const BaseTransitionImpl = {
|
|
|
1189
1218
|
earlyRemove();
|
|
1190
1219
|
el[leaveCbKey] = void 0;
|
|
1191
1220
|
delete enterHooks.delayedLeave;
|
|
1221
|
+
oldInnerChild = void 0;
|
|
1222
|
+
};
|
|
1223
|
+
enterHooks.delayedLeave = () => {
|
|
1224
|
+
delayedLeave();
|
|
1225
|
+
delete enterHooks.delayedLeave;
|
|
1226
|
+
oldInnerChild = void 0;
|
|
1192
1227
|
};
|
|
1193
|
-
enterHooks.delayedLeave = delayedLeave;
|
|
1194
1228
|
};
|
|
1229
|
+
} else {
|
|
1230
|
+
oldInnerChild = void 0;
|
|
1195
1231
|
}
|
|
1232
|
+
} else if (oldInnerChild) {
|
|
1233
|
+
oldInnerChild = void 0;
|
|
1196
1234
|
}
|
|
1197
1235
|
return child;
|
|
1198
1236
|
};
|
|
@@ -1497,6 +1535,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1497
1535
|
return;
|
|
1498
1536
|
}
|
|
1499
1537
|
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
1538
|
+
if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
|
|
1539
|
+
setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
|
|
1540
|
+
}
|
|
1500
1541
|
return;
|
|
1501
1542
|
}
|
|
1502
1543
|
const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
|
|
@@ -1513,8 +1554,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1513
1554
|
const setupState = owner.setupState;
|
|
1514
1555
|
const rawSetupState = reactivity.toRaw(setupState);
|
|
1515
1556
|
const canSetSetupRef = setupState === shared.EMPTY_OBJ ? () => false : (key) => {
|
|
1516
|
-
|
|
1517
|
-
|
|
1557
|
+
{
|
|
1558
|
+
if (shared.hasOwn(rawSetupState, key) && !reactivity.isRef(rawSetupState[key])) {
|
|
1559
|
+
warn$1(
|
|
1560
|
+
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
1561
|
+
);
|
|
1562
|
+
}
|
|
1563
|
+
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
1564
|
+
return false;
|
|
1565
|
+
}
|
|
1518
1566
|
}
|
|
1519
1567
|
return shared.hasOwn(rawSetupState, key);
|
|
1520
1568
|
};
|
|
@@ -1754,7 +1802,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1754
1802
|
getContainerType(container),
|
|
1755
1803
|
optimized
|
|
1756
1804
|
);
|
|
1757
|
-
if (isAsyncWrapper(vnode)) {
|
|
1805
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
|
|
1758
1806
|
let subTree;
|
|
1759
1807
|
if (isFragmentStart) {
|
|
1760
1808
|
subTree = createVNode(Fragment);
|
|
@@ -1811,7 +1859,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1811
1859
|
}
|
|
1812
1860
|
let needCallTransitionHooks = false;
|
|
1813
1861
|
if (isTemplateNode(el)) {
|
|
1814
|
-
needCallTransitionHooks = needTransition(
|
|
1862
|
+
needCallTransitionHooks = needTransition(
|
|
1863
|
+
null,
|
|
1864
|
+
// no need check parentSuspense in hydration
|
|
1865
|
+
transition
|
|
1866
|
+
) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
1815
1867
|
const content = el.content.firstChild;
|
|
1816
1868
|
if (needCallTransitionHooks) {
|
|
1817
1869
|
transition.beforeEnter(content);
|
|
@@ -2019,6 +2071,10 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
2019
2071
|
getContainerType(container),
|
|
2020
2072
|
slotScopeIds
|
|
2021
2073
|
);
|
|
2074
|
+
if (parentComponent) {
|
|
2075
|
+
parentComponent.vnode.el = vnode.el;
|
|
2076
|
+
updateHOCHostEl(parentComponent, vnode.el);
|
|
2077
|
+
}
|
|
2022
2078
|
return next;
|
|
2023
2079
|
};
|
|
2024
2080
|
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
@@ -2204,6 +2260,8 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
2204
2260
|
}
|
|
2205
2261
|
}
|
|
2206
2262
|
|
|
2263
|
+
const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
2264
|
+
const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
2207
2265
|
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
2208
2266
|
const id = requestIdleCallback(hydrate, { timeout });
|
|
2209
2267
|
return () => cancelIdleCallback(id);
|
|
@@ -2906,12 +2964,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2906
2964
|
}
|
|
2907
2965
|
openBlock();
|
|
2908
2966
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2967
|
+
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
2968
|
+
// key attached in the `createSlots` helper, respect that
|
|
2969
|
+
validSlotContent && validSlotContent.key;
|
|
2909
2970
|
const rendered = createBlock(
|
|
2910
2971
|
Fragment,
|
|
2911
2972
|
{
|
|
2912
|
-
key: (
|
|
2913
|
-
// key attached in the `createSlots` helper, respect that
|
|
2914
|
-
validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2973
|
+
key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2915
2974
|
(!validSlotContent && fallback ? "_fb" : "")
|
|
2916
2975
|
},
|
|
2917
2976
|
validSlotContent || (fallback ? fallback() : []),
|
|
@@ -4269,6 +4328,7 @@ function getType(ctor) {
|
|
|
4269
4328
|
function validateProps(rawProps, props, instance) {
|
|
4270
4329
|
const resolvedValues = reactivity.toRaw(props);
|
|
4271
4330
|
const options = instance.propsOptions[0];
|
|
4331
|
+
const camelizePropsKey = Object.keys(rawProps).map((key) => shared.camelize(key));
|
|
4272
4332
|
for (const key in options) {
|
|
4273
4333
|
let opt = options[key];
|
|
4274
4334
|
if (opt == null) continue;
|
|
@@ -4277,7 +4337,7 @@ function validateProps(rawProps, props, instance) {
|
|
|
4277
4337
|
resolvedValues[key],
|
|
4278
4338
|
opt,
|
|
4279
4339
|
reactivity.shallowReadonly(resolvedValues) ,
|
|
4280
|
-
!
|
|
4340
|
+
!camelizePropsKey.includes(key)
|
|
4281
4341
|
);
|
|
4282
4342
|
}
|
|
4283
4343
|
}
|
|
@@ -6057,14 +6117,13 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
|
6057
6117
|
}
|
|
6058
6118
|
const baseWatchOptions = shared.extend({}, options);
|
|
6059
6119
|
baseWatchOptions.onWarn = warn$1;
|
|
6120
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
6060
6121
|
let ssrCleanup;
|
|
6061
6122
|
if (isInSSRComponentSetup) {
|
|
6062
6123
|
if (flush === "sync") {
|
|
6063
6124
|
const ctx = useSSRContext();
|
|
6064
6125
|
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
6065
|
-
} else if (!
|
|
6066
|
-
baseWatchOptions.once = true;
|
|
6067
|
-
} else {
|
|
6126
|
+
} else if (!runsImmediately) {
|
|
6068
6127
|
const watchStopHandle = () => {
|
|
6069
6128
|
};
|
|
6070
6129
|
watchStopHandle.stop = shared.NOOP;
|
|
@@ -6103,7 +6162,13 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
|
6103
6162
|
}
|
|
6104
6163
|
};
|
|
6105
6164
|
const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
|
|
6106
|
-
if (
|
|
6165
|
+
if (isInSSRComponentSetup) {
|
|
6166
|
+
if (ssrCleanup) {
|
|
6167
|
+
ssrCleanup.push(watchHandle);
|
|
6168
|
+
} else if (runsImmediately) {
|
|
6169
|
+
watchHandle();
|
|
6170
|
+
}
|
|
6171
|
+
}
|
|
6107
6172
|
return watchHandle;
|
|
6108
6173
|
}
|
|
6109
6174
|
function instanceWatch(source, value, options) {
|
|
@@ -6138,19 +6203,19 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
|
6138
6203
|
warn$1(`useModel() called without active instance.`);
|
|
6139
6204
|
return reactivity.ref();
|
|
6140
6205
|
}
|
|
6141
|
-
|
|
6206
|
+
const camelizedName = shared.camelize(name);
|
|
6207
|
+
if (!i.propsOptions[0][camelizedName]) {
|
|
6142
6208
|
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
6143
6209
|
return reactivity.ref();
|
|
6144
6210
|
}
|
|
6145
|
-
const camelizedName = shared.camelize(name);
|
|
6146
6211
|
const hyphenatedName = shared.hyphenate(name);
|
|
6147
|
-
const modifiers = getModelModifiers(props,
|
|
6212
|
+
const modifiers = getModelModifiers(props, camelizedName);
|
|
6148
6213
|
const res = reactivity.customRef((track, trigger) => {
|
|
6149
6214
|
let localValue;
|
|
6150
6215
|
let prevSetValue = shared.EMPTY_OBJ;
|
|
6151
6216
|
let prevEmittedValue;
|
|
6152
6217
|
watchSyncEffect(() => {
|
|
6153
|
-
const propValue = props[
|
|
6218
|
+
const propValue = props[camelizedName];
|
|
6154
6219
|
if (shared.hasChanged(localValue, propValue)) {
|
|
6155
6220
|
localValue = propValue;
|
|
6156
6221
|
trigger();
|
|
@@ -6449,7 +6514,7 @@ function renderComponentRoot(instance) {
|
|
|
6449
6514
|
}
|
|
6450
6515
|
if (extraAttrs.length) {
|
|
6451
6516
|
warn$1(
|
|
6452
|
-
`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
|
|
6517
|
+
`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
|
|
6453
6518
|
);
|
|
6454
6519
|
}
|
|
6455
6520
|
if (eventAttrs.length) {
|
|
@@ -7232,9 +7297,9 @@ function closeBlock() {
|
|
|
7232
7297
|
currentBlock = blockStack[blockStack.length - 1] || null;
|
|
7233
7298
|
}
|
|
7234
7299
|
let isBlockTreeEnabled = 1;
|
|
7235
|
-
function setBlockTracking(value) {
|
|
7300
|
+
function setBlockTracking(value, inVOnce = false) {
|
|
7236
7301
|
isBlockTreeEnabled += value;
|
|
7237
|
-
if (value < 0 && currentBlock) {
|
|
7302
|
+
if (value < 0 && currentBlock && inVOnce) {
|
|
7238
7303
|
currentBlock.hasOnce = true;
|
|
7239
7304
|
}
|
|
7240
7305
|
}
|
|
@@ -7777,9 +7842,9 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7777
7842
|
}
|
|
7778
7843
|
const { setup } = Component;
|
|
7779
7844
|
if (setup) {
|
|
7845
|
+
reactivity.pauseTracking();
|
|
7780
7846
|
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
|
|
7781
7847
|
const reset = setCurrentInstance(instance);
|
|
7782
|
-
reactivity.pauseTracking();
|
|
7783
7848
|
const setupResult = callWithErrorHandling(
|
|
7784
7849
|
setup,
|
|
7785
7850
|
instance,
|
|
@@ -7789,10 +7854,13 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7789
7854
|
setupContext
|
|
7790
7855
|
]
|
|
7791
7856
|
);
|
|
7857
|
+
const isAsyncSetup = shared.isPromise(setupResult);
|
|
7792
7858
|
reactivity.resetTracking();
|
|
7793
7859
|
reset();
|
|
7794
|
-
if (
|
|
7795
|
-
|
|
7860
|
+
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
|
|
7861
|
+
markAsyncBoundary(instance);
|
|
7862
|
+
}
|
|
7863
|
+
if (isAsyncSetup) {
|
|
7796
7864
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
7797
7865
|
if (isSSR) {
|
|
7798
7866
|
return setupResult.then((resolvedResult) => {
|
|
@@ -8255,7 +8323,7 @@ function isMemoSame(cached, memo) {
|
|
|
8255
8323
|
return true;
|
|
8256
8324
|
}
|
|
8257
8325
|
|
|
8258
|
-
const version = "3.5.
|
|
8326
|
+
const version = "3.5.13";
|
|
8259
8327
|
const warn = warn$1 ;
|
|
8260
8328
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8261
8329
|
const devtools = devtools$1 ;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.13
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -440,20 +440,41 @@ const TeleportImpl = {
|
|
|
440
440
|
}
|
|
441
441
|
if (!disabled) {
|
|
442
442
|
mount(target, targetAnchor);
|
|
443
|
-
updateCssVars(n2);
|
|
443
|
+
updateCssVars(n2, false);
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
446
|
};
|
|
447
447
|
if (disabled) {
|
|
448
448
|
mount(container, mainAnchor);
|
|
449
|
-
updateCssVars(n2);
|
|
449
|
+
updateCssVars(n2, true);
|
|
450
450
|
}
|
|
451
451
|
if (isTeleportDeferred(n2.props)) {
|
|
452
|
-
queuePostRenderEffect(
|
|
452
|
+
queuePostRenderEffect(() => {
|
|
453
|
+
mountToTarget();
|
|
454
|
+
n2.el.__isMounted = true;
|
|
455
|
+
}, parentSuspense);
|
|
453
456
|
} else {
|
|
454
457
|
mountToTarget();
|
|
455
458
|
}
|
|
456
459
|
} else {
|
|
460
|
+
if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
|
|
461
|
+
queuePostRenderEffect(() => {
|
|
462
|
+
TeleportImpl.process(
|
|
463
|
+
n1,
|
|
464
|
+
n2,
|
|
465
|
+
container,
|
|
466
|
+
anchor,
|
|
467
|
+
parentComponent,
|
|
468
|
+
parentSuspense,
|
|
469
|
+
namespace,
|
|
470
|
+
slotScopeIds,
|
|
471
|
+
optimized,
|
|
472
|
+
internals
|
|
473
|
+
);
|
|
474
|
+
delete n1.el.__isMounted;
|
|
475
|
+
}, parentSuspense);
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
457
478
|
n2.el = n1.el;
|
|
458
479
|
n2.targetStart = n1.targetStart;
|
|
459
480
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
@@ -530,7 +551,7 @@ const TeleportImpl = {
|
|
|
530
551
|
);
|
|
531
552
|
}
|
|
532
553
|
}
|
|
533
|
-
updateCssVars(n2);
|
|
554
|
+
updateCssVars(n2, disabled);
|
|
534
555
|
}
|
|
535
556
|
},
|
|
536
557
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
@@ -598,9 +619,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
598
619
|
querySelector
|
|
599
620
|
);
|
|
600
621
|
if (target) {
|
|
622
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
601
623
|
const targetNode = target._lpa || target.firstChild;
|
|
602
624
|
if (vnode.shapeFlag & 16) {
|
|
603
|
-
if (
|
|
625
|
+
if (disabled) {
|
|
604
626
|
vnode.anchor = hydrateChildren(
|
|
605
627
|
nextSibling(node),
|
|
606
628
|
vnode,
|
|
@@ -641,16 +663,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
641
663
|
);
|
|
642
664
|
}
|
|
643
665
|
}
|
|
644
|
-
updateCssVars(vnode);
|
|
666
|
+
updateCssVars(vnode, disabled);
|
|
645
667
|
}
|
|
646
668
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
647
669
|
}
|
|
648
670
|
const Teleport = TeleportImpl;
|
|
649
|
-
function updateCssVars(vnode) {
|
|
671
|
+
function updateCssVars(vnode, isDisabled) {
|
|
650
672
|
const ctx = vnode.ctx;
|
|
651
673
|
if (ctx && ctx.ut) {
|
|
652
|
-
let node
|
|
653
|
-
|
|
674
|
+
let node, anchor;
|
|
675
|
+
if (isDisabled) {
|
|
676
|
+
node = vnode.el;
|
|
677
|
+
anchor = vnode.anchor;
|
|
678
|
+
} else {
|
|
679
|
+
node = vnode.targetStart;
|
|
680
|
+
anchor = vnode.targetAnchor;
|
|
681
|
+
}
|
|
682
|
+
while (node && node !== anchor) {
|
|
654
683
|
if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
|
|
655
684
|
node = node.nextSibling;
|
|
656
685
|
}
|
|
@@ -742,10 +771,9 @@ const BaseTransitionImpl = {
|
|
|
742
771
|
if (innerChild.type !== Comment) {
|
|
743
772
|
setTransitionHooks(innerChild, enterHooks);
|
|
744
773
|
}
|
|
745
|
-
|
|
746
|
-
const oldInnerChild = oldChild && getInnerChild$1(oldChild);
|
|
774
|
+
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
747
775
|
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
748
|
-
|
|
776
|
+
let leavingHooks = resolveTransitionHooks(
|
|
749
777
|
oldInnerChild,
|
|
750
778
|
rawProps,
|
|
751
779
|
state,
|
|
@@ -760,6 +788,7 @@ const BaseTransitionImpl = {
|
|
|
760
788
|
instance.update();
|
|
761
789
|
}
|
|
762
790
|
delete leavingHooks.afterLeave;
|
|
791
|
+
oldInnerChild = void 0;
|
|
763
792
|
};
|
|
764
793
|
return emptyPlaceholder(child);
|
|
765
794
|
} else if (mode === "in-out" && innerChild.type !== Comment) {
|
|
@@ -773,10 +802,19 @@ const BaseTransitionImpl = {
|
|
|
773
802
|
earlyRemove();
|
|
774
803
|
el[leaveCbKey] = void 0;
|
|
775
804
|
delete enterHooks.delayedLeave;
|
|
805
|
+
oldInnerChild = void 0;
|
|
806
|
+
};
|
|
807
|
+
enterHooks.delayedLeave = () => {
|
|
808
|
+
delayedLeave();
|
|
809
|
+
delete enterHooks.delayedLeave;
|
|
810
|
+
oldInnerChild = void 0;
|
|
776
811
|
};
|
|
777
|
-
enterHooks.delayedLeave = delayedLeave;
|
|
778
812
|
};
|
|
813
|
+
} else {
|
|
814
|
+
oldInnerChild = void 0;
|
|
779
815
|
}
|
|
816
|
+
} else if (oldInnerChild) {
|
|
817
|
+
oldInnerChild = void 0;
|
|
780
818
|
}
|
|
781
819
|
return child;
|
|
782
820
|
};
|
|
@@ -1056,6 +1094,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1056
1094
|
return;
|
|
1057
1095
|
}
|
|
1058
1096
|
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
1097
|
+
if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
|
|
1098
|
+
setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
|
|
1099
|
+
}
|
|
1059
1100
|
return;
|
|
1060
1101
|
}
|
|
1061
1102
|
const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
|
|
@@ -1284,7 +1325,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1284
1325
|
getContainerType(container),
|
|
1285
1326
|
optimized
|
|
1286
1327
|
);
|
|
1287
|
-
if (isAsyncWrapper(vnode)) {
|
|
1328
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
|
|
1288
1329
|
let subTree;
|
|
1289
1330
|
if (isFragmentStart) {
|
|
1290
1331
|
subTree = createVNode(Fragment);
|
|
@@ -1339,7 +1380,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1339
1380
|
}
|
|
1340
1381
|
let needCallTransitionHooks = false;
|
|
1341
1382
|
if (isTemplateNode(el)) {
|
|
1342
|
-
needCallTransitionHooks = needTransition(
|
|
1383
|
+
needCallTransitionHooks = needTransition(
|
|
1384
|
+
null,
|
|
1385
|
+
// no need check parentSuspense in hydration
|
|
1386
|
+
transition
|
|
1387
|
+
) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
1343
1388
|
const content = el.content.firstChild;
|
|
1344
1389
|
if (needCallTransitionHooks) {
|
|
1345
1390
|
transition.beforeEnter(content);
|
|
@@ -1517,6 +1562,10 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1517
1562
|
getContainerType(container),
|
|
1518
1563
|
slotScopeIds
|
|
1519
1564
|
);
|
|
1565
|
+
if (parentComponent) {
|
|
1566
|
+
parentComponent.vnode.el = vnode.el;
|
|
1567
|
+
updateHOCHostEl(parentComponent, vnode.el);
|
|
1568
|
+
}
|
|
1520
1569
|
return next;
|
|
1521
1570
|
};
|
|
1522
1571
|
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
@@ -1582,6 +1631,8 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
1582
1631
|
}
|
|
1583
1632
|
}
|
|
1584
1633
|
|
|
1634
|
+
const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
1635
|
+
const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
1585
1636
|
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
1586
1637
|
const id = requestIdleCallback(hydrate, { timeout });
|
|
1587
1638
|
return () => cancelIdleCallback(id);
|
|
@@ -2241,12 +2292,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2241
2292
|
}
|
|
2242
2293
|
openBlock();
|
|
2243
2294
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2295
|
+
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
2296
|
+
// key attached in the `createSlots` helper, respect that
|
|
2297
|
+
validSlotContent && validSlotContent.key;
|
|
2244
2298
|
const rendered = createBlock(
|
|
2245
2299
|
Fragment,
|
|
2246
2300
|
{
|
|
2247
|
-
key: (
|
|
2248
|
-
// key attached in the `createSlots` helper, respect that
|
|
2249
|
-
validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2301
|
+
key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2250
2302
|
(!validSlotContent && fallback ? "_fb" : "")
|
|
2251
2303
|
},
|
|
2252
2304
|
validSlotContent || (fallback ? fallback() : []),
|
|
@@ -4739,14 +4791,13 @@ function watch(source, cb, options) {
|
|
|
4739
4791
|
function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
4740
4792
|
const { immediate, deep, flush, once } = options;
|
|
4741
4793
|
const baseWatchOptions = shared.extend({}, options);
|
|
4794
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
4742
4795
|
let ssrCleanup;
|
|
4743
4796
|
if (isInSSRComponentSetup) {
|
|
4744
4797
|
if (flush === "sync") {
|
|
4745
4798
|
const ctx = useSSRContext();
|
|
4746
4799
|
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
4747
|
-
} else if (!
|
|
4748
|
-
baseWatchOptions.once = true;
|
|
4749
|
-
} else {
|
|
4800
|
+
} else if (!runsImmediately) {
|
|
4750
4801
|
const watchStopHandle = () => {
|
|
4751
4802
|
};
|
|
4752
4803
|
watchStopHandle.stop = shared.NOOP;
|
|
@@ -4785,7 +4836,13 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
|
4785
4836
|
}
|
|
4786
4837
|
};
|
|
4787
4838
|
const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
|
|
4788
|
-
if (
|
|
4839
|
+
if (isInSSRComponentSetup) {
|
|
4840
|
+
if (ssrCleanup) {
|
|
4841
|
+
ssrCleanup.push(watchHandle);
|
|
4842
|
+
} else if (runsImmediately) {
|
|
4843
|
+
watchHandle();
|
|
4844
|
+
}
|
|
4845
|
+
}
|
|
4789
4846
|
return watchHandle;
|
|
4790
4847
|
}
|
|
4791
4848
|
function instanceWatch(source, value, options) {
|
|
@@ -4818,13 +4875,13 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
|
4818
4875
|
const i = getCurrentInstance();
|
|
4819
4876
|
const camelizedName = shared.camelize(name);
|
|
4820
4877
|
const hyphenatedName = shared.hyphenate(name);
|
|
4821
|
-
const modifiers = getModelModifiers(props,
|
|
4878
|
+
const modifiers = getModelModifiers(props, camelizedName);
|
|
4822
4879
|
const res = reactivity.customRef((track, trigger) => {
|
|
4823
4880
|
let localValue;
|
|
4824
4881
|
let prevSetValue = shared.EMPTY_OBJ;
|
|
4825
4882
|
let prevEmittedValue;
|
|
4826
4883
|
watchSyncEffect(() => {
|
|
4827
|
-
const propValue = props[
|
|
4884
|
+
const propValue = props[camelizedName];
|
|
4828
4885
|
if (shared.hasChanged(localValue, propValue)) {
|
|
4829
4886
|
localValue = propValue;
|
|
4830
4887
|
trigger();
|
|
@@ -5755,9 +5812,9 @@ function closeBlock() {
|
|
|
5755
5812
|
currentBlock = blockStack[blockStack.length - 1] || null;
|
|
5756
5813
|
}
|
|
5757
5814
|
let isBlockTreeEnabled = 1;
|
|
5758
|
-
function setBlockTracking(value) {
|
|
5815
|
+
function setBlockTracking(value, inVOnce = false) {
|
|
5759
5816
|
isBlockTreeEnabled += value;
|
|
5760
|
-
if (value < 0 && currentBlock) {
|
|
5817
|
+
if (value < 0 && currentBlock && inVOnce) {
|
|
5761
5818
|
currentBlock.hasOnce = true;
|
|
5762
5819
|
}
|
|
5763
5820
|
}
|
|
@@ -6229,9 +6286,9 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6229
6286
|
instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
|
|
6230
6287
|
const { setup } = Component;
|
|
6231
6288
|
if (setup) {
|
|
6289
|
+
reactivity.pauseTracking();
|
|
6232
6290
|
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
|
|
6233
6291
|
const reset = setCurrentInstance(instance);
|
|
6234
|
-
reactivity.pauseTracking();
|
|
6235
6292
|
const setupResult = callWithErrorHandling(
|
|
6236
6293
|
setup,
|
|
6237
6294
|
instance,
|
|
@@ -6241,10 +6298,13 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6241
6298
|
setupContext
|
|
6242
6299
|
]
|
|
6243
6300
|
);
|
|
6301
|
+
const isAsyncSetup = shared.isPromise(setupResult);
|
|
6244
6302
|
reactivity.resetTracking();
|
|
6245
6303
|
reset();
|
|
6246
|
-
if (
|
|
6247
|
-
|
|
6304
|
+
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
|
|
6305
|
+
markAsyncBoundary(instance);
|
|
6306
|
+
}
|
|
6307
|
+
if (isAsyncSetup) {
|
|
6248
6308
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
6249
6309
|
if (isSSR) {
|
|
6250
6310
|
return setupResult.then((resolvedResult) => {
|
|
@@ -6424,7 +6484,7 @@ function isMemoSame(cached, memo) {
|
|
|
6424
6484
|
return true;
|
|
6425
6485
|
}
|
|
6426
6486
|
|
|
6427
|
-
const version = "3.5.
|
|
6487
|
+
const version = "3.5.13";
|
|
6428
6488
|
const warn$1 = shared.NOOP;
|
|
6429
6489
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6430
6490
|
const devtools = void 0;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -223,7 +223,7 @@ type BooleanKey<T, K extends keyof T = keyof T> = K extends any ? [T[K]] extends
|
|
|
223
223
|
export declare function defineEmits<EE extends string = string>(emitOptions: EE[]): EmitFn<EE[]>;
|
|
224
224
|
export declare function defineEmits<E extends EmitsOptions = EmitsOptions>(emitOptions: E): EmitFn<E>;
|
|
225
225
|
export declare function defineEmits<T extends ComponentTypeEmits>(): T extends (...args: any[]) => any ? T : ShortEmits<T>;
|
|
226
|
-
export type ComponentTypeEmits = ((...args: any[]) => any) | Record<string, any
|
|
226
|
+
export type ComponentTypeEmits = ((...args: any[]) => any) | Record<string, any>;
|
|
227
227
|
type RecordToUnion<T extends Record<string, any>> = T[keyof T];
|
|
228
228
|
type ShortEmits<T extends Record<string, any>> = UnionToIntersection<RecordToUnion<{
|
|
229
229
|
[K in keyof T]: (evt: K, ...args: T[K]) => void;
|
|
@@ -331,11 +331,11 @@ type InferDefaults<T> = {
|
|
|
331
331
|
};
|
|
332
332
|
type NativeType = null | number | string | boolean | symbol | Function;
|
|
333
333
|
type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
|
|
334
|
-
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Readonly<MappedOmit<T, keyof Defaults>> & {
|
|
334
|
+
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = T extends unknown ? Readonly<MappedOmit<T, keyof Defaults>> & {
|
|
335
335
|
readonly [K in keyof Defaults as K extends keyof T ? K : never]-?: K extends keyof T ? Defaults[K] extends undefined ? IfAny<Defaults[K], NotUndefined<T[K]>, T[K]> : NotUndefined<T[K]> : never;
|
|
336
336
|
} & {
|
|
337
337
|
readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean;
|
|
338
|
-
};
|
|
338
|
+
} : never;
|
|
339
339
|
/**
|
|
340
340
|
* Vue `<script setup>` compiler macro for providing props default values when
|
|
341
341
|
* using type-based `defineProps` declaration.
|
|
@@ -1012,7 +1012,7 @@ export declare function defineComponent<TypeProps, RuntimePropsOptions extends C
|
|
|
1012
1012
|
*/
|
|
1013
1013
|
__typeEl?: TypeEl;
|
|
1014
1014
|
} & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
|
1015
|
-
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits,
|
|
1015
|
+
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
|
|
1016
1016
|
|
|
1017
1017
|
export interface App<HostElement = any> {
|
|
1018
1018
|
version: string;
|
|
@@ -1251,7 +1251,7 @@ export declare function openBlock(disableTracking?: boolean): void;
|
|
|
1251
1251
|
*
|
|
1252
1252
|
* ``` js
|
|
1253
1253
|
* _cache[1] || (
|
|
1254
|
-
* setBlockTracking(-1),
|
|
1254
|
+
* setBlockTracking(-1, true),
|
|
1255
1255
|
* _cache[1] = createVNode(...),
|
|
1256
1256
|
* setBlockTracking(1),
|
|
1257
1257
|
* _cache[1]
|
|
@@ -1260,7 +1260,7 @@ export declare function openBlock(disableTracking?: boolean): void;
|
|
|
1260
1260
|
*
|
|
1261
1261
|
* @private
|
|
1262
1262
|
*/
|
|
1263
|
-
export declare function setBlockTracking(value: number): void;
|
|
1263
|
+
export declare function setBlockTracking(value: number, inVOnce?: boolean): void;
|
|
1264
1264
|
/**
|
|
1265
1265
|
* @private
|
|
1266
1266
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.13
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
import { pauseTracking, resetTracking, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, shallowReadArray, toReactive, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, watch as watch$1, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, isReadonly } from '@vue/reactivity';
|
|
7
7
|
export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
8
|
-
import { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, capitalize, camelize, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, toRawType, makeMap, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared';
|
|
8
|
+
import { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, capitalize, camelize, isSymbol, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, toRawType, makeMap, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared';
|
|
9
9
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
10
10
|
|
|
11
11
|
const stack = [];
|
|
@@ -844,7 +844,7 @@ const TeleportImpl = {
|
|
|
844
844
|
}
|
|
845
845
|
if (!disabled) {
|
|
846
846
|
mount(target, targetAnchor);
|
|
847
|
-
updateCssVars(n2);
|
|
847
|
+
updateCssVars(n2, false);
|
|
848
848
|
}
|
|
849
849
|
} else if (!!(process.env.NODE_ENV !== "production") && !disabled) {
|
|
850
850
|
warn$1(
|
|
@@ -856,14 +856,35 @@ const TeleportImpl = {
|
|
|
856
856
|
};
|
|
857
857
|
if (disabled) {
|
|
858
858
|
mount(container, mainAnchor);
|
|
859
|
-
updateCssVars(n2);
|
|
859
|
+
updateCssVars(n2, true);
|
|
860
860
|
}
|
|
861
861
|
if (isTeleportDeferred(n2.props)) {
|
|
862
|
-
queuePostRenderEffect(
|
|
862
|
+
queuePostRenderEffect(() => {
|
|
863
|
+
mountToTarget();
|
|
864
|
+
n2.el.__isMounted = true;
|
|
865
|
+
}, parentSuspense);
|
|
863
866
|
} else {
|
|
864
867
|
mountToTarget();
|
|
865
868
|
}
|
|
866
869
|
} else {
|
|
870
|
+
if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
|
|
871
|
+
queuePostRenderEffect(() => {
|
|
872
|
+
TeleportImpl.process(
|
|
873
|
+
n1,
|
|
874
|
+
n2,
|
|
875
|
+
container,
|
|
876
|
+
anchor,
|
|
877
|
+
parentComponent,
|
|
878
|
+
parentSuspense,
|
|
879
|
+
namespace,
|
|
880
|
+
slotScopeIds,
|
|
881
|
+
optimized,
|
|
882
|
+
internals
|
|
883
|
+
);
|
|
884
|
+
delete n1.el.__isMounted;
|
|
885
|
+
}, parentSuspense);
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
867
888
|
n2.el = n1.el;
|
|
868
889
|
n2.targetStart = n1.targetStart;
|
|
869
890
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
@@ -946,7 +967,7 @@ const TeleportImpl = {
|
|
|
946
967
|
);
|
|
947
968
|
}
|
|
948
969
|
}
|
|
949
|
-
updateCssVars(n2);
|
|
970
|
+
updateCssVars(n2, disabled);
|
|
950
971
|
}
|
|
951
972
|
},
|
|
952
973
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
@@ -1014,9 +1035,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
1014
1035
|
querySelector
|
|
1015
1036
|
);
|
|
1016
1037
|
if (target) {
|
|
1038
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
1017
1039
|
const targetNode = target._lpa || target.firstChild;
|
|
1018
1040
|
if (vnode.shapeFlag & 16) {
|
|
1019
|
-
if (
|
|
1041
|
+
if (disabled) {
|
|
1020
1042
|
vnode.anchor = hydrateChildren(
|
|
1021
1043
|
nextSibling(node),
|
|
1022
1044
|
vnode,
|
|
@@ -1057,16 +1079,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
1057
1079
|
);
|
|
1058
1080
|
}
|
|
1059
1081
|
}
|
|
1060
|
-
updateCssVars(vnode);
|
|
1082
|
+
updateCssVars(vnode, disabled);
|
|
1061
1083
|
}
|
|
1062
1084
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
1063
1085
|
}
|
|
1064
1086
|
const Teleport = TeleportImpl;
|
|
1065
|
-
function updateCssVars(vnode) {
|
|
1087
|
+
function updateCssVars(vnode, isDisabled) {
|
|
1066
1088
|
const ctx = vnode.ctx;
|
|
1067
1089
|
if (ctx && ctx.ut) {
|
|
1068
|
-
let node
|
|
1069
|
-
|
|
1090
|
+
let node, anchor;
|
|
1091
|
+
if (isDisabled) {
|
|
1092
|
+
node = vnode.el;
|
|
1093
|
+
anchor = vnode.anchor;
|
|
1094
|
+
} else {
|
|
1095
|
+
node = vnode.targetStart;
|
|
1096
|
+
anchor = vnode.targetAnchor;
|
|
1097
|
+
}
|
|
1098
|
+
while (node && node !== anchor) {
|
|
1070
1099
|
if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
|
|
1071
1100
|
node = node.nextSibling;
|
|
1072
1101
|
}
|
|
@@ -1161,10 +1190,9 @@ const BaseTransitionImpl = {
|
|
|
1161
1190
|
if (innerChild.type !== Comment) {
|
|
1162
1191
|
setTransitionHooks(innerChild, enterHooks);
|
|
1163
1192
|
}
|
|
1164
|
-
|
|
1165
|
-
const oldInnerChild = oldChild && getInnerChild$1(oldChild);
|
|
1193
|
+
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
1166
1194
|
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
1167
|
-
|
|
1195
|
+
let leavingHooks = resolveTransitionHooks(
|
|
1168
1196
|
oldInnerChild,
|
|
1169
1197
|
rawProps,
|
|
1170
1198
|
state,
|
|
@@ -1179,6 +1207,7 @@ const BaseTransitionImpl = {
|
|
|
1179
1207
|
instance.update();
|
|
1180
1208
|
}
|
|
1181
1209
|
delete leavingHooks.afterLeave;
|
|
1210
|
+
oldInnerChild = void 0;
|
|
1182
1211
|
};
|
|
1183
1212
|
return emptyPlaceholder(child);
|
|
1184
1213
|
} else if (mode === "in-out" && innerChild.type !== Comment) {
|
|
@@ -1192,10 +1221,19 @@ const BaseTransitionImpl = {
|
|
|
1192
1221
|
earlyRemove();
|
|
1193
1222
|
el[leaveCbKey] = void 0;
|
|
1194
1223
|
delete enterHooks.delayedLeave;
|
|
1224
|
+
oldInnerChild = void 0;
|
|
1225
|
+
};
|
|
1226
|
+
enterHooks.delayedLeave = () => {
|
|
1227
|
+
delayedLeave();
|
|
1228
|
+
delete enterHooks.delayedLeave;
|
|
1229
|
+
oldInnerChild = void 0;
|
|
1195
1230
|
};
|
|
1196
|
-
enterHooks.delayedLeave = delayedLeave;
|
|
1197
1231
|
};
|
|
1232
|
+
} else {
|
|
1233
|
+
oldInnerChild = void 0;
|
|
1198
1234
|
}
|
|
1235
|
+
} else if (oldInnerChild) {
|
|
1236
|
+
oldInnerChild = void 0;
|
|
1199
1237
|
}
|
|
1200
1238
|
return child;
|
|
1201
1239
|
};
|
|
@@ -1501,6 +1539,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1501
1539
|
return;
|
|
1502
1540
|
}
|
|
1503
1541
|
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
1542
|
+
if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
|
|
1543
|
+
setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
|
|
1544
|
+
}
|
|
1504
1545
|
return;
|
|
1505
1546
|
}
|
|
1506
1547
|
const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
|
|
@@ -1517,8 +1558,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1517
1558
|
const setupState = owner.setupState;
|
|
1518
1559
|
const rawSetupState = toRaw(setupState);
|
|
1519
1560
|
const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
|
|
1520
|
-
if (!!(process.env.NODE_ENV !== "production")
|
|
1521
|
-
|
|
1561
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1562
|
+
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
|
|
1563
|
+
warn$1(
|
|
1564
|
+
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
1565
|
+
);
|
|
1566
|
+
}
|
|
1567
|
+
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
1568
|
+
return false;
|
|
1569
|
+
}
|
|
1522
1570
|
}
|
|
1523
1571
|
return hasOwn(rawSetupState, key);
|
|
1524
1572
|
};
|
|
@@ -1758,7 +1806,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1758
1806
|
getContainerType(container),
|
|
1759
1807
|
optimized
|
|
1760
1808
|
);
|
|
1761
|
-
if (isAsyncWrapper(vnode)) {
|
|
1809
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
|
|
1762
1810
|
let subTree;
|
|
1763
1811
|
if (isFragmentStart) {
|
|
1764
1812
|
subTree = createVNode(Fragment);
|
|
@@ -1815,7 +1863,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1815
1863
|
}
|
|
1816
1864
|
let needCallTransitionHooks = false;
|
|
1817
1865
|
if (isTemplateNode(el)) {
|
|
1818
|
-
needCallTransitionHooks = needTransition(
|
|
1866
|
+
needCallTransitionHooks = needTransition(
|
|
1867
|
+
null,
|
|
1868
|
+
// no need check parentSuspense in hydration
|
|
1869
|
+
transition
|
|
1870
|
+
) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
1819
1871
|
const content = el.content.firstChild;
|
|
1820
1872
|
if (needCallTransitionHooks) {
|
|
1821
1873
|
transition.beforeEnter(content);
|
|
@@ -2034,6 +2086,10 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
2034
2086
|
getContainerType(container),
|
|
2035
2087
|
slotScopeIds
|
|
2036
2088
|
);
|
|
2089
|
+
if (parentComponent) {
|
|
2090
|
+
parentComponent.vnode.el = vnode.el;
|
|
2091
|
+
updateHOCHostEl(parentComponent, vnode.el);
|
|
2092
|
+
}
|
|
2037
2093
|
return next;
|
|
2038
2094
|
};
|
|
2039
2095
|
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
@@ -2219,6 +2275,8 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
2219
2275
|
}
|
|
2220
2276
|
}
|
|
2221
2277
|
|
|
2278
|
+
const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
2279
|
+
const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
2222
2280
|
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
2223
2281
|
const id = requestIdleCallback(hydrate, { timeout });
|
|
2224
2282
|
return () => cancelIdleCallback(id);
|
|
@@ -2921,12 +2979,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2921
2979
|
}
|
|
2922
2980
|
openBlock();
|
|
2923
2981
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2982
|
+
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
2983
|
+
// key attached in the `createSlots` helper, respect that
|
|
2984
|
+
validSlotContent && validSlotContent.key;
|
|
2924
2985
|
const rendered = createBlock(
|
|
2925
2986
|
Fragment,
|
|
2926
2987
|
{
|
|
2927
|
-
key: (
|
|
2928
|
-
// key attached in the `createSlots` helper, respect that
|
|
2929
|
-
validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2988
|
+
key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2930
2989
|
(!validSlotContent && fallback ? "_fb" : "")
|
|
2931
2990
|
},
|
|
2932
2991
|
validSlotContent || (fallback ? fallback() : []),
|
|
@@ -4288,6 +4347,7 @@ function getType(ctor) {
|
|
|
4288
4347
|
function validateProps(rawProps, props, instance) {
|
|
4289
4348
|
const resolvedValues = toRaw(props);
|
|
4290
4349
|
const options = instance.propsOptions[0];
|
|
4350
|
+
const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
|
|
4291
4351
|
for (const key in options) {
|
|
4292
4352
|
let opt = options[key];
|
|
4293
4353
|
if (opt == null) continue;
|
|
@@ -4296,7 +4356,7 @@ function validateProps(rawProps, props, instance) {
|
|
|
4296
4356
|
resolvedValues[key],
|
|
4297
4357
|
opt,
|
|
4298
4358
|
!!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues,
|
|
4299
|
-
!
|
|
4359
|
+
!camelizePropsKey.includes(key)
|
|
4300
4360
|
);
|
|
4301
4361
|
}
|
|
4302
4362
|
}
|
|
@@ -6114,14 +6174,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
|
6114
6174
|
}
|
|
6115
6175
|
const baseWatchOptions = extend({}, options);
|
|
6116
6176
|
if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
|
|
6177
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
6117
6178
|
let ssrCleanup;
|
|
6118
6179
|
if (isInSSRComponentSetup) {
|
|
6119
6180
|
if (flush === "sync") {
|
|
6120
6181
|
const ctx = useSSRContext();
|
|
6121
6182
|
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
6122
|
-
} else if (!
|
|
6123
|
-
baseWatchOptions.once = true;
|
|
6124
|
-
} else {
|
|
6183
|
+
} else if (!runsImmediately) {
|
|
6125
6184
|
const watchStopHandle = () => {
|
|
6126
6185
|
};
|
|
6127
6186
|
watchStopHandle.stop = NOOP;
|
|
@@ -6160,7 +6219,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
|
6160
6219
|
}
|
|
6161
6220
|
};
|
|
6162
6221
|
const watchHandle = watch$1(source, cb, baseWatchOptions);
|
|
6163
|
-
if (
|
|
6222
|
+
if (isInSSRComponentSetup) {
|
|
6223
|
+
if (ssrCleanup) {
|
|
6224
|
+
ssrCleanup.push(watchHandle);
|
|
6225
|
+
} else if (runsImmediately) {
|
|
6226
|
+
watchHandle();
|
|
6227
|
+
}
|
|
6228
|
+
}
|
|
6164
6229
|
return watchHandle;
|
|
6165
6230
|
}
|
|
6166
6231
|
function instanceWatch(source, value, options) {
|
|
@@ -6195,19 +6260,19 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
6195
6260
|
warn$1(`useModel() called without active instance.`);
|
|
6196
6261
|
return ref();
|
|
6197
6262
|
}
|
|
6198
|
-
|
|
6263
|
+
const camelizedName = camelize(name);
|
|
6264
|
+
if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][camelizedName]) {
|
|
6199
6265
|
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
6200
6266
|
return ref();
|
|
6201
6267
|
}
|
|
6202
|
-
const camelizedName = camelize(name);
|
|
6203
6268
|
const hyphenatedName = hyphenate(name);
|
|
6204
|
-
const modifiers = getModelModifiers(props,
|
|
6269
|
+
const modifiers = getModelModifiers(props, camelizedName);
|
|
6205
6270
|
const res = customRef((track, trigger) => {
|
|
6206
6271
|
let localValue;
|
|
6207
6272
|
let prevSetValue = EMPTY_OBJ;
|
|
6208
6273
|
let prevEmittedValue;
|
|
6209
6274
|
watchSyncEffect(() => {
|
|
6210
|
-
const propValue = props[
|
|
6275
|
+
const propValue = props[camelizedName];
|
|
6211
6276
|
if (hasChanged(localValue, propValue)) {
|
|
6212
6277
|
localValue = propValue;
|
|
6213
6278
|
trigger();
|
|
@@ -6506,7 +6571,7 @@ function renderComponentRoot(instance) {
|
|
|
6506
6571
|
}
|
|
6507
6572
|
if (extraAttrs.length) {
|
|
6508
6573
|
warn$1(
|
|
6509
|
-
`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
|
|
6574
|
+
`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
|
|
6510
6575
|
);
|
|
6511
6576
|
}
|
|
6512
6577
|
if (eventAttrs.length) {
|
|
@@ -7289,9 +7354,9 @@ function closeBlock() {
|
|
|
7289
7354
|
currentBlock = blockStack[blockStack.length - 1] || null;
|
|
7290
7355
|
}
|
|
7291
7356
|
let isBlockTreeEnabled = 1;
|
|
7292
|
-
function setBlockTracking(value) {
|
|
7357
|
+
function setBlockTracking(value, inVOnce = false) {
|
|
7293
7358
|
isBlockTreeEnabled += value;
|
|
7294
|
-
if (value < 0 && currentBlock) {
|
|
7359
|
+
if (value < 0 && currentBlock && inVOnce) {
|
|
7295
7360
|
currentBlock.hasOnce = true;
|
|
7296
7361
|
}
|
|
7297
7362
|
}
|
|
@@ -7836,9 +7901,9 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7836
7901
|
}
|
|
7837
7902
|
const { setup } = Component;
|
|
7838
7903
|
if (setup) {
|
|
7904
|
+
pauseTracking();
|
|
7839
7905
|
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
|
|
7840
7906
|
const reset = setCurrentInstance(instance);
|
|
7841
|
-
pauseTracking();
|
|
7842
7907
|
const setupResult = callWithErrorHandling(
|
|
7843
7908
|
setup,
|
|
7844
7909
|
instance,
|
|
@@ -7848,10 +7913,13 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7848
7913
|
setupContext
|
|
7849
7914
|
]
|
|
7850
7915
|
);
|
|
7916
|
+
const isAsyncSetup = isPromise(setupResult);
|
|
7851
7917
|
resetTracking();
|
|
7852
7918
|
reset();
|
|
7853
|
-
if (
|
|
7854
|
-
|
|
7919
|
+
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
|
|
7920
|
+
markAsyncBoundary(instance);
|
|
7921
|
+
}
|
|
7922
|
+
if (isAsyncSetup) {
|
|
7855
7923
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
7856
7924
|
if (isSSR) {
|
|
7857
7925
|
return setupResult.then((resolvedResult) => {
|
|
@@ -7917,7 +7985,7 @@ function finishComponentSetup(instance, isSSR, skipOptions) {
|
|
|
7917
7985
|
const Component = instance.type;
|
|
7918
7986
|
if (!instance.render) {
|
|
7919
7987
|
if (!isSSR && compile && !Component.render) {
|
|
7920
|
-
const template = Component.template || resolveMergedOptions(instance).template;
|
|
7988
|
+
const template = Component.template || __VUE_OPTIONS_API__ && resolveMergedOptions(instance).template;
|
|
7921
7989
|
if (template) {
|
|
7922
7990
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
7923
7991
|
startMeasure(instance, `compile`);
|
|
@@ -8326,7 +8394,7 @@ function isMemoSame(cached, memo) {
|
|
|
8326
8394
|
return true;
|
|
8327
8395
|
}
|
|
8328
8396
|
|
|
8329
|
-
const version = "3.5.
|
|
8397
|
+
const version = "3.5.13";
|
|
8330
8398
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
8331
8399
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8332
8400
|
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.13",
|
|
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.13",
|
|
50
|
+
"@vue/reactivity": "3.5.13"
|
|
51
51
|
}
|
|
52
52
|
}
|