@vue/runtime-core 3.3.7 → 3.3.9
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 +107 -74
- package/dist/runtime-core.cjs.prod.js +80 -64
- package/dist/runtime-core.d.ts +25 -24
- package/dist/runtime-core.esm-bundler.js +109 -76
- package/package.json +3 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -813,9 +813,19 @@ function renderComponentRoot(instance) {
|
|
|
813
813
|
try {
|
|
814
814
|
if (vnode.shapeFlag & 4) {
|
|
815
815
|
const proxyToUse = withProxy || proxy;
|
|
816
|
+
const thisProxy = setupState.__isScriptSetup ? new Proxy(proxyToUse, {
|
|
817
|
+
get(target, key, receiver) {
|
|
818
|
+
warn(
|
|
819
|
+
`Property '${String(
|
|
820
|
+
key
|
|
821
|
+
)}' was accessed via 'this'. Avoid using 'this' in templates.`
|
|
822
|
+
);
|
|
823
|
+
return Reflect.get(target, key, receiver);
|
|
824
|
+
}
|
|
825
|
+
}) : proxyToUse;
|
|
816
826
|
result = normalizeVNode(
|
|
817
827
|
render.call(
|
|
818
|
-
|
|
828
|
+
thisProxy,
|
|
819
829
|
proxyToUse,
|
|
820
830
|
renderCache,
|
|
821
831
|
props,
|
|
@@ -1050,6 +1060,61 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
1050
1060
|
}
|
|
1051
1061
|
}
|
|
1052
1062
|
|
|
1063
|
+
const COMPONENTS = "components";
|
|
1064
|
+
const DIRECTIVES = "directives";
|
|
1065
|
+
function resolveComponent(name, maybeSelfReference) {
|
|
1066
|
+
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
1067
|
+
}
|
|
1068
|
+
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
1069
|
+
function resolveDynamicComponent(component) {
|
|
1070
|
+
if (shared.isString(component)) {
|
|
1071
|
+
return resolveAsset(COMPONENTS, component, false) || component;
|
|
1072
|
+
} else {
|
|
1073
|
+
return component || NULL_DYNAMIC_COMPONENT;
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1076
|
+
function resolveDirective(name) {
|
|
1077
|
+
return resolveAsset(DIRECTIVES, name);
|
|
1078
|
+
}
|
|
1079
|
+
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
1080
|
+
const instance = currentRenderingInstance || currentInstance;
|
|
1081
|
+
if (instance) {
|
|
1082
|
+
const Component = instance.type;
|
|
1083
|
+
if (type === COMPONENTS) {
|
|
1084
|
+
const selfName = getComponentName(
|
|
1085
|
+
Component,
|
|
1086
|
+
false
|
|
1087
|
+
/* do not include inferred name to avoid breaking existing code */
|
|
1088
|
+
);
|
|
1089
|
+
if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
|
|
1090
|
+
return Component;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
const res = (
|
|
1094
|
+
// local registration
|
|
1095
|
+
// check instance[type] first which is resolved for options API
|
|
1096
|
+
resolve(instance[type] || Component[type], name) || // global registration
|
|
1097
|
+
resolve(instance.appContext[type], name)
|
|
1098
|
+
);
|
|
1099
|
+
if (!res && maybeSelfReference) {
|
|
1100
|
+
return Component;
|
|
1101
|
+
}
|
|
1102
|
+
if (warnMissing && !res) {
|
|
1103
|
+
const extra = type === COMPONENTS ? `
|
|
1104
|
+
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
|
|
1105
|
+
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
1106
|
+
}
|
|
1107
|
+
return res;
|
|
1108
|
+
} else {
|
|
1109
|
+
warn(
|
|
1110
|
+
`resolve${shared.capitalize(type.slice(0, -1))} can only be used in render() or setup().`
|
|
1111
|
+
);
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
function resolve(registry, name) {
|
|
1115
|
+
return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1053
1118
|
const isSuspense = (type) => type.__isSuspense;
|
|
1054
1119
|
const SuspenseImpl = {
|
|
1055
1120
|
name: "Suspense",
|
|
@@ -1584,7 +1649,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
1584
1649
|
}
|
|
1585
1650
|
if (shared.isArray(s)) {
|
|
1586
1651
|
const singleChild = filterSingleRoot(s);
|
|
1587
|
-
if (!singleChild) {
|
|
1652
|
+
if (!singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
|
|
1588
1653
|
warn(`<Suspense> slots expect a single root node.`);
|
|
1589
1654
|
}
|
|
1590
1655
|
s = singleChild;
|
|
@@ -1722,6 +1787,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
|
|
|
1722
1787
|
let onCleanup = (fn) => {
|
|
1723
1788
|
cleanup = effect.onStop = () => {
|
|
1724
1789
|
callWithErrorHandling(fn, instance, 4);
|
|
1790
|
+
cleanup = effect.onStop = void 0;
|
|
1725
1791
|
};
|
|
1726
1792
|
};
|
|
1727
1793
|
let ssrCleanup;
|
|
@@ -2213,7 +2279,11 @@ function emptyPlaceholder(vnode) {
|
|
|
2213
2279
|
}
|
|
2214
2280
|
}
|
|
2215
2281
|
function getKeepAliveChild(vnode) {
|
|
2216
|
-
return isKeepAlive(vnode) ?
|
|
2282
|
+
return isKeepAlive(vnode) ? (
|
|
2283
|
+
// #7121 ensure get the child component subtree in case
|
|
2284
|
+
// it's been replaced during HMR
|
|
2285
|
+
vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0
|
|
2286
|
+
) : vnode;
|
|
2217
2287
|
}
|
|
2218
2288
|
function setTransitionHooks(vnode, hooks) {
|
|
2219
2289
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
@@ -2696,61 +2766,6 @@ function onErrorCaptured(hook, target = currentInstance) {
|
|
|
2696
2766
|
injectHook("ec", hook, target);
|
|
2697
2767
|
}
|
|
2698
2768
|
|
|
2699
|
-
const COMPONENTS = "components";
|
|
2700
|
-
const DIRECTIVES = "directives";
|
|
2701
|
-
function resolveComponent(name, maybeSelfReference) {
|
|
2702
|
-
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
2703
|
-
}
|
|
2704
|
-
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2705
|
-
function resolveDynamicComponent(component) {
|
|
2706
|
-
if (shared.isString(component)) {
|
|
2707
|
-
return resolveAsset(COMPONENTS, component, false) || component;
|
|
2708
|
-
} else {
|
|
2709
|
-
return component || NULL_DYNAMIC_COMPONENT;
|
|
2710
|
-
}
|
|
2711
|
-
}
|
|
2712
|
-
function resolveDirective(name) {
|
|
2713
|
-
return resolveAsset(DIRECTIVES, name);
|
|
2714
|
-
}
|
|
2715
|
-
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
2716
|
-
const instance = currentRenderingInstance || currentInstance;
|
|
2717
|
-
if (instance) {
|
|
2718
|
-
const Component = instance.type;
|
|
2719
|
-
if (type === COMPONENTS) {
|
|
2720
|
-
const selfName = getComponentName(
|
|
2721
|
-
Component,
|
|
2722
|
-
false
|
|
2723
|
-
/* do not include inferred name to avoid breaking existing code */
|
|
2724
|
-
);
|
|
2725
|
-
if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
|
|
2726
|
-
return Component;
|
|
2727
|
-
}
|
|
2728
|
-
}
|
|
2729
|
-
const res = (
|
|
2730
|
-
// local registration
|
|
2731
|
-
// check instance[type] first which is resolved for options API
|
|
2732
|
-
resolve(instance[type] || Component[type], name) || // global registration
|
|
2733
|
-
resolve(instance.appContext[type], name)
|
|
2734
|
-
);
|
|
2735
|
-
if (!res && maybeSelfReference) {
|
|
2736
|
-
return Component;
|
|
2737
|
-
}
|
|
2738
|
-
if (warnMissing && !res) {
|
|
2739
|
-
const extra = type === COMPONENTS ? `
|
|
2740
|
-
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
|
|
2741
|
-
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
2742
|
-
}
|
|
2743
|
-
return res;
|
|
2744
|
-
} else {
|
|
2745
|
-
warn(
|
|
2746
|
-
`resolve${shared.capitalize(type.slice(0, -1))} can only be used in render() or setup().`
|
|
2747
|
-
);
|
|
2748
|
-
}
|
|
2749
|
-
}
|
|
2750
|
-
function resolve(registry, name) {
|
|
2751
|
-
return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
|
|
2752
|
-
}
|
|
2753
|
-
|
|
2754
2769
|
function renderList(source, renderItem, cache, index) {
|
|
2755
2770
|
let ret;
|
|
2756
2771
|
const cached = cache && cache[index];
|
|
@@ -4267,6 +4282,9 @@ function assertType(value, type) {
|
|
|
4267
4282
|
};
|
|
4268
4283
|
}
|
|
4269
4284
|
function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
4285
|
+
if (expectedTypes.length === 0) {
|
|
4286
|
+
return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
|
|
4287
|
+
}
|
|
4270
4288
|
let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(shared.capitalize).join(" | ")}`;
|
|
4271
4289
|
const expectedType = expectedTypes[0];
|
|
4272
4290
|
const receivedType = shared.toRawType(value);
|
|
@@ -4536,6 +4554,20 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4536
4554
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
4537
4555
|
let domType = node.nodeType;
|
|
4538
4556
|
vnode.el = node;
|
|
4557
|
+
{
|
|
4558
|
+
if (!("__vnode" in node)) {
|
|
4559
|
+
Object.defineProperty(node, "__vnode", {
|
|
4560
|
+
value: vnode,
|
|
4561
|
+
enumerable: false
|
|
4562
|
+
});
|
|
4563
|
+
}
|
|
4564
|
+
if (!("__vueParentComponent" in node)) {
|
|
4565
|
+
Object.defineProperty(node, "__vueParentComponent", {
|
|
4566
|
+
value: parentComponent,
|
|
4567
|
+
enumerable: false
|
|
4568
|
+
});
|
|
4569
|
+
}
|
|
4570
|
+
}
|
|
4539
4571
|
if (patchFlag === -2) {
|
|
4540
4572
|
optimized = false;
|
|
4541
4573
|
vnode.dynamicChildren = null;
|
|
@@ -4566,15 +4598,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4566
4598
|
}
|
|
4567
4599
|
break;
|
|
4568
4600
|
case Comment:
|
|
4569
|
-
if (
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4573
|
-
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4601
|
+
if (isTemplateNode(node)) {
|
|
4602
|
+
nextNode = nextSibling(node);
|
|
4603
|
+
replaceNode(
|
|
4604
|
+
vnode.el = node.content.firstChild,
|
|
4605
|
+
node,
|
|
4606
|
+
parentComponent
|
|
4607
|
+
);
|
|
4608
|
+
} else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
4609
|
+
nextNode = onMismatch();
|
|
4578
4610
|
} else {
|
|
4579
4611
|
nextNode = nextSibling(node);
|
|
4580
4612
|
}
|
|
@@ -4697,15 +4729,16 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4697
4729
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
4698
4730
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4699
4731
|
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4700
|
-
const
|
|
4732
|
+
const forcePatch = type === "input" || type === "option";
|
|
4701
4733
|
{
|
|
4702
4734
|
if (dirs) {
|
|
4703
4735
|
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
4704
4736
|
}
|
|
4705
4737
|
if (props) {
|
|
4706
|
-
if (
|
|
4738
|
+
if (forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
4707
4739
|
for (const key in props) {
|
|
4708
|
-
if (
|
|
4740
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
4741
|
+
key[0] === ".") {
|
|
4709
4742
|
patchProp(
|
|
4710
4743
|
el,
|
|
4711
4744
|
key,
|
|
@@ -4918,8 +4951,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4918
4951
|
let parent = parentComponent;
|
|
4919
4952
|
while (parent) {
|
|
4920
4953
|
if (parent.vnode.el === oldNode) {
|
|
4921
|
-
parent.vnode.el = newNode;
|
|
4922
|
-
parent.subTree.el = newNode;
|
|
4954
|
+
parent.vnode.el = parent.subTree.el = newNode;
|
|
4923
4955
|
}
|
|
4924
4956
|
parent = parent.parent;
|
|
4925
4957
|
}
|
|
@@ -6463,6 +6495,7 @@ const resolveTarget = (props, select) => {
|
|
|
6463
6495
|
}
|
|
6464
6496
|
};
|
|
6465
6497
|
const TeleportImpl = {
|
|
6498
|
+
name: "Teleport",
|
|
6466
6499
|
__isTeleport: true,
|
|
6467
6500
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
|
|
6468
6501
|
const {
|
|
@@ -6884,7 +6917,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
6884
6917
|
if (shapeFlag & 4 && reactivity.isProxy(type)) {
|
|
6885
6918
|
type = reactivity.toRaw(type);
|
|
6886
6919
|
warn(
|
|
6887
|
-
`Vue received a Component
|
|
6920
|
+
`Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
|
|
6888
6921
|
`
|
|
6889
6922
|
Component that was made reactive: `,
|
|
6890
6923
|
type
|
|
@@ -7721,7 +7754,7 @@ function isMemoSame(cached, memo) {
|
|
|
7721
7754
|
return true;
|
|
7722
7755
|
}
|
|
7723
7756
|
|
|
7724
|
-
const version = "3.3.
|
|
7757
|
+
const version = "3.3.9";
|
|
7725
7758
|
const _ssrUtils = {
|
|
7726
7759
|
createComponentInstance,
|
|
7727
7760
|
setupComponent,
|
|
@@ -400,9 +400,19 @@ function renderComponentRoot(instance) {
|
|
|
400
400
|
try {
|
|
401
401
|
if (vnode.shapeFlag & 4) {
|
|
402
402
|
const proxyToUse = withProxy || proxy;
|
|
403
|
+
const thisProxy = false ? new Proxy(proxyToUse, {
|
|
404
|
+
get(target, key, receiver) {
|
|
405
|
+
warn(
|
|
406
|
+
`Property '${String(
|
|
407
|
+
key
|
|
408
|
+
)}' was accessed via 'this'. Avoid using 'this' in templates.`
|
|
409
|
+
);
|
|
410
|
+
return Reflect.get(target, key, receiver);
|
|
411
|
+
}
|
|
412
|
+
}) : proxyToUse;
|
|
403
413
|
result = normalizeVNode(
|
|
404
414
|
render.call(
|
|
405
|
-
|
|
415
|
+
thisProxy,
|
|
406
416
|
proxyToUse,
|
|
407
417
|
renderCache,
|
|
408
418
|
props,
|
|
@@ -568,6 +578,52 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
568
578
|
}
|
|
569
579
|
}
|
|
570
580
|
|
|
581
|
+
const COMPONENTS = "components";
|
|
582
|
+
const DIRECTIVES = "directives";
|
|
583
|
+
function resolveComponent(name, maybeSelfReference) {
|
|
584
|
+
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
585
|
+
}
|
|
586
|
+
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
587
|
+
function resolveDynamicComponent(component) {
|
|
588
|
+
if (shared.isString(component)) {
|
|
589
|
+
return resolveAsset(COMPONENTS, component, false) || component;
|
|
590
|
+
} else {
|
|
591
|
+
return component || NULL_DYNAMIC_COMPONENT;
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
function resolveDirective(name) {
|
|
595
|
+
return resolveAsset(DIRECTIVES, name);
|
|
596
|
+
}
|
|
597
|
+
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
598
|
+
const instance = currentRenderingInstance || currentInstance;
|
|
599
|
+
if (instance) {
|
|
600
|
+
const Component = instance.type;
|
|
601
|
+
if (type === COMPONENTS) {
|
|
602
|
+
const selfName = getComponentName(
|
|
603
|
+
Component,
|
|
604
|
+
false
|
|
605
|
+
/* do not include inferred name to avoid breaking existing code */
|
|
606
|
+
);
|
|
607
|
+
if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
|
|
608
|
+
return Component;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
const res = (
|
|
612
|
+
// local registration
|
|
613
|
+
// check instance[type] first which is resolved for options API
|
|
614
|
+
resolve(instance[type] || Component[type], name) || // global registration
|
|
615
|
+
resolve(instance.appContext[type], name)
|
|
616
|
+
);
|
|
617
|
+
if (!res && maybeSelfReference) {
|
|
618
|
+
return Component;
|
|
619
|
+
}
|
|
620
|
+
return res;
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
function resolve(registry, name) {
|
|
624
|
+
return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
|
|
625
|
+
}
|
|
626
|
+
|
|
571
627
|
const isSuspense = (type) => type.__isSuspense;
|
|
572
628
|
const SuspenseImpl = {
|
|
573
629
|
name: "Suspense",
|
|
@@ -1182,6 +1238,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = sh
|
|
|
1182
1238
|
let onCleanup = (fn) => {
|
|
1183
1239
|
cleanup = effect.onStop = () => {
|
|
1184
1240
|
callWithErrorHandling(fn, instance, 4);
|
|
1241
|
+
cleanup = effect.onStop = void 0;
|
|
1185
1242
|
};
|
|
1186
1243
|
};
|
|
1187
1244
|
let ssrCleanup;
|
|
@@ -1653,7 +1710,11 @@ function emptyPlaceholder(vnode) {
|
|
|
1653
1710
|
}
|
|
1654
1711
|
}
|
|
1655
1712
|
function getKeepAliveChild(vnode) {
|
|
1656
|
-
return isKeepAlive(vnode) ?
|
|
1713
|
+
return isKeepAlive(vnode) ? (
|
|
1714
|
+
// #7121 ensure get the child component subtree in case
|
|
1715
|
+
// it's been replaced during HMR
|
|
1716
|
+
vnode.children ? vnode.children[0] : void 0
|
|
1717
|
+
) : vnode;
|
|
1657
1718
|
}
|
|
1658
1719
|
function setTransitionHooks(vnode, hooks) {
|
|
1659
1720
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
@@ -2111,52 +2172,6 @@ function onErrorCaptured(hook, target = currentInstance) {
|
|
|
2111
2172
|
injectHook("ec", hook, target);
|
|
2112
2173
|
}
|
|
2113
2174
|
|
|
2114
|
-
const COMPONENTS = "components";
|
|
2115
|
-
const DIRECTIVES = "directives";
|
|
2116
|
-
function resolveComponent(name, maybeSelfReference) {
|
|
2117
|
-
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
2118
|
-
}
|
|
2119
|
-
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2120
|
-
function resolveDynamicComponent(component) {
|
|
2121
|
-
if (shared.isString(component)) {
|
|
2122
|
-
return resolveAsset(COMPONENTS, component, false) || component;
|
|
2123
|
-
} else {
|
|
2124
|
-
return component || NULL_DYNAMIC_COMPONENT;
|
|
2125
|
-
}
|
|
2126
|
-
}
|
|
2127
|
-
function resolveDirective(name) {
|
|
2128
|
-
return resolveAsset(DIRECTIVES, name);
|
|
2129
|
-
}
|
|
2130
|
-
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
2131
|
-
const instance = currentRenderingInstance || currentInstance;
|
|
2132
|
-
if (instance) {
|
|
2133
|
-
const Component = instance.type;
|
|
2134
|
-
if (type === COMPONENTS) {
|
|
2135
|
-
const selfName = getComponentName(
|
|
2136
|
-
Component,
|
|
2137
|
-
false
|
|
2138
|
-
/* do not include inferred name to avoid breaking existing code */
|
|
2139
|
-
);
|
|
2140
|
-
if (selfName && (selfName === name || selfName === shared.camelize(name) || selfName === shared.capitalize(shared.camelize(name)))) {
|
|
2141
|
-
return Component;
|
|
2142
|
-
}
|
|
2143
|
-
}
|
|
2144
|
-
const res = (
|
|
2145
|
-
// local registration
|
|
2146
|
-
// check instance[type] first which is resolved for options API
|
|
2147
|
-
resolve(instance[type] || Component[type], name) || // global registration
|
|
2148
|
-
resolve(instance.appContext[type], name)
|
|
2149
|
-
);
|
|
2150
|
-
if (!res && maybeSelfReference) {
|
|
2151
|
-
return Component;
|
|
2152
|
-
}
|
|
2153
|
-
return res;
|
|
2154
|
-
}
|
|
2155
|
-
}
|
|
2156
|
-
function resolve(registry, name) {
|
|
2157
|
-
return registry && (registry[name] || registry[shared.camelize(name)] || registry[shared.capitalize(shared.camelize(name))]);
|
|
2158
|
-
}
|
|
2159
|
-
|
|
2160
2175
|
function renderList(source, renderItem, cache, index) {
|
|
2161
2176
|
let ret;
|
|
2162
2177
|
const cached = cache && cache[index];
|
|
@@ -3498,15 +3513,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3498
3513
|
}
|
|
3499
3514
|
break;
|
|
3500
3515
|
case Comment:
|
|
3501
|
-
if (
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3505
|
-
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3516
|
+
if (isTemplateNode(node)) {
|
|
3517
|
+
nextNode = nextSibling(node);
|
|
3518
|
+
replaceNode(
|
|
3519
|
+
vnode.el = node.content.firstChild,
|
|
3520
|
+
node,
|
|
3521
|
+
parentComponent
|
|
3522
|
+
);
|
|
3523
|
+
} else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
3524
|
+
nextNode = onMismatch();
|
|
3510
3525
|
} else {
|
|
3511
3526
|
nextNode = nextSibling(node);
|
|
3512
3527
|
}
|
|
@@ -3627,15 +3642,16 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3627
3642
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
3628
3643
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
3629
3644
|
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
3630
|
-
const
|
|
3631
|
-
if (
|
|
3645
|
+
const forcePatch = type === "input" || type === "option";
|
|
3646
|
+
if (forcePatch || patchFlag !== -1) {
|
|
3632
3647
|
if (dirs) {
|
|
3633
3648
|
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
3634
3649
|
}
|
|
3635
3650
|
if (props) {
|
|
3636
|
-
if (
|
|
3651
|
+
if (forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
3637
3652
|
for (const key in props) {
|
|
3638
|
-
if (
|
|
3653
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || shared.isOn(key) && !shared.isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
3654
|
+
key[0] === ".") {
|
|
3639
3655
|
patchProp(
|
|
3640
3656
|
el,
|
|
3641
3657
|
key,
|
|
@@ -3820,8 +3836,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
3820
3836
|
let parent = parentComponent;
|
|
3821
3837
|
while (parent) {
|
|
3822
3838
|
if (parent.vnode.el === oldNode) {
|
|
3823
|
-
parent.vnode.el = newNode;
|
|
3824
|
-
parent.subTree.el = newNode;
|
|
3839
|
+
parent.vnode.el = parent.subTree.el = newNode;
|
|
3825
3840
|
}
|
|
3826
3841
|
parent = parent.parent;
|
|
3827
3842
|
}
|
|
@@ -5174,6 +5189,7 @@ const resolveTarget = (props, select) => {
|
|
|
5174
5189
|
}
|
|
5175
5190
|
};
|
|
5176
5191
|
const TeleportImpl = {
|
|
5192
|
+
name: "Teleport",
|
|
5177
5193
|
__isTeleport: true,
|
|
5178
5194
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
|
|
5179
5195
|
const {
|
|
@@ -6070,7 +6086,7 @@ function isMemoSame(cached, memo) {
|
|
|
6070
6086
|
return true;
|
|
6071
6087
|
}
|
|
6072
6088
|
|
|
6073
|
-
const version = "3.3.
|
|
6089
|
+
const version = "3.3.9";
|
|
6074
6090
|
const _ssrUtils = {
|
|
6075
6091
|
createComponentInstance,
|
|
6076
6092
|
setupComponent,
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -126,7 +126,7 @@ C extends ComputedOptions = {}, M extends MethodOptions = {}, E extends EmitsOpt
|
|
|
126
126
|
$forceUpdate: () => void;
|
|
127
127
|
$nextTick: typeof nextTick;
|
|
128
128
|
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R]) => any : (...args: any) => any, options?: WatchOptions): WatchStopHandle;
|
|
129
|
-
} & P & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>;
|
|
129
|
+
} & IfAny<P, P, Omit<P, keyof ShallowUnwrapRef<B>>> & ShallowUnwrapRef<B> & UnwrapNestedRefs<D> & ExtractComputedReturns<C> & M & ComponentCustomProperties & InjectToObject<I>;
|
|
130
130
|
|
|
131
131
|
declare const enum LifecycleHooks {
|
|
132
132
|
BEFORE_CREATE = "bc",
|
|
@@ -737,6 +737,25 @@ export declare function inject<T>(key: InjectionKey<T> | string, defaultValue: T
|
|
|
737
737
|
*/
|
|
738
738
|
export declare function hasInjectionContext(): boolean;
|
|
739
739
|
|
|
740
|
+
type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
741
|
+
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
|
742
|
+
export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}> = ComponentPublicInstanceConstructor<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, true, {}, S>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S> & PP;
|
|
743
|
+
export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
|
744
|
+
props?: (keyof Props)[];
|
|
745
|
+
emits?: E | EE[];
|
|
746
|
+
slots?: S;
|
|
747
|
+
}): (props: Props & EmitsToProps<E>) => any;
|
|
748
|
+
export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
|
749
|
+
props?: ComponentObjectPropsOptions<Props>;
|
|
750
|
+
emits?: E | EE[];
|
|
751
|
+
slots?: S;
|
|
752
|
+
}): (props: Props & EmitsToProps<E>) => any;
|
|
753
|
+
export declare function defineComponent<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<Props, E>, ExtractDefaultPropTypes<Props>, S>;
|
|
754
|
+
export declare function defineComponent<PropNames extends string, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string, Props = Readonly<{
|
|
755
|
+
[key in PropNames]?: any;
|
|
756
|
+
}>>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<Props, E>, ExtractDefaultPropTypes<Props>, S>;
|
|
757
|
+
export declare function defineComponent<PropsOptions extends Readonly<ComponentPropsOptions>, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<PropsOptions, E>, ExtractDefaultPropTypes<PropsOptions>, S>;
|
|
758
|
+
|
|
740
759
|
export interface App<HostElement = any> {
|
|
741
760
|
version: string;
|
|
742
761
|
config: AppConfig;
|
|
@@ -744,7 +763,7 @@ export interface App<HostElement = any> {
|
|
|
744
763
|
use<Options>(plugin: Plugin<Options>, options: Options): this;
|
|
745
764
|
mixin(mixin: ComponentOptions): this;
|
|
746
765
|
component(name: string): Component | undefined;
|
|
747
|
-
component(name: string, component: Component): this;
|
|
766
|
+
component(name: string, component: Component | DefineComponent): this;
|
|
748
767
|
directive(name: string): Directive | undefined;
|
|
749
768
|
directive(name: string, directive: Directive): this;
|
|
750
769
|
mount(rootContainer: HostElement | string, isHydrate?: boolean, isSVG?: boolean): ComponentPublicInstance;
|
|
@@ -814,6 +833,7 @@ export interface TeleportProps {
|
|
|
814
833
|
disabled?: boolean;
|
|
815
834
|
}
|
|
816
835
|
declare const TeleportImpl: {
|
|
836
|
+
name: string;
|
|
817
837
|
__isTeleport: boolean;
|
|
818
838
|
process(n1: TeleportVNode | null, n2: TeleportVNode, container: RendererElement, anchor: RendererNode | null, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, isSVG: boolean, slotScopeIds: string[] | null, optimized: boolean, internals: RendererInternals): void;
|
|
819
839
|
remove(vnode: VNode, parentComponent: ComponentInternalInstance | null, parentSuspense: SuspenseBoundary | null, optimized: boolean, { um: unmount, o: { remove: hostRemove } }: RendererInternals, doRemove: boolean): void;
|
|
@@ -1123,25 +1143,6 @@ export declare function watch<T extends Readonly<MultiWatchSources>, Immediate e
|
|
|
1123
1143
|
export declare function watch<T, Immediate extends Readonly<boolean> = false>(source: WatchSource<T>, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
1124
1144
|
export declare function watch<T extends object, Immediate extends Readonly<boolean> = false>(source: T, cb: WatchCallback<T, Immediate extends true ? T | undefined : T>, options?: WatchOptions<Immediate>): WatchStopHandle;
|
|
1125
1145
|
|
|
1126
|
-
type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
1127
|
-
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
|
1128
|
-
export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}> = ComponentPublicInstanceConstructor<CreateComponentPublicInstance<Props, RawBindings, D, C, M, Mixin, Extends, E, PP & Props, Defaults, true, {}, S> & Props> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S> & PP;
|
|
1129
|
-
export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
|
1130
|
-
props?: (keyof Props)[];
|
|
1131
|
-
emits?: E | EE[];
|
|
1132
|
-
slots?: S;
|
|
1133
|
-
}): (props: Props & EmitsToProps<E>) => any;
|
|
1134
|
-
export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
|
1135
|
-
props?: ComponentObjectPropsOptions<Props>;
|
|
1136
|
-
emits?: E | EE[];
|
|
1137
|
-
slots?: S;
|
|
1138
|
-
}): (props: Props & EmitsToProps<E>) => any;
|
|
1139
|
-
export declare function defineComponent<Props = {}, RawBindings = {}, D = {}, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithoutProps<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<Props, E>, ExtractDefaultPropTypes<Props>, S>;
|
|
1140
|
-
export declare function defineComponent<PropNames extends string, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string, Props = Readonly<{
|
|
1141
|
-
[key in PropNames]?: any;
|
|
1142
|
-
}>>(options: ComponentOptionsWithArrayProps<PropNames, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<Props, E>, ExtractDefaultPropTypes<Props>, S>;
|
|
1143
|
-
export declare function defineComponent<PropsOptions extends Readonly<ComponentPropsOptions>, RawBindings, D, C extends ComputedOptions = {}, M extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}, I extends ComponentInjectOptions = {}, II extends string = string>(options: ComponentOptionsWithObjectProps<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, I, II, S>): DefineComponent<PropsOptions, RawBindings, D, C, M, Mixin, Extends, E, EE, PublicProps, ResolveProps<PropsOptions, E>, ExtractDefaultPropTypes<PropsOptions>, S>;
|
|
1144
|
-
|
|
1145
1146
|
type AsyncComponentResolveResult<T = Component> = T | {
|
|
1146
1147
|
default: T;
|
|
1147
1148
|
};
|
|
@@ -1196,7 +1197,7 @@ export declare function defineProps<PropNames extends string = string>(props: Pr
|
|
|
1196
1197
|
[key in PropNames]?: any;
|
|
1197
1198
|
}>>;
|
|
1198
1199
|
export declare function defineProps<PP extends ComponentObjectPropsOptions = ComponentObjectPropsOptions>(props: PP): Prettify<Readonly<ExtractPropTypes<PP>>>;
|
|
1199
|
-
export declare function defineProps<TypeProps>(): DefineProps<TypeProps
|
|
1200
|
+
export declare function defineProps<TypeProps>(): DefineProps<LooseRequired<TypeProps>, BooleanKey<TypeProps>>;
|
|
1200
1201
|
type DefineProps<T, BKeys extends keyof T> = Readonly<T> & {
|
|
1201
1202
|
readonly [K in BKeys]-?: boolean;
|
|
1202
1203
|
};
|
|
@@ -1319,8 +1320,8 @@ type InferDefaults<T> = {
|
|
|
1319
1320
|
};
|
|
1320
1321
|
type NativeType = null | number | string | boolean | symbol | Function;
|
|
1321
1322
|
type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
|
|
1322
|
-
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Omit<T, keyof Defaults
|
|
1323
|
-
[K in keyof Defaults]-?: K extends keyof T ? Defaults[K] extends undefined ? T[K] : NotUndefined<T[K]> : never;
|
|
1323
|
+
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Readonly<Omit<T, keyof Defaults>> & {
|
|
1324
|
+
readonly [K in keyof Defaults]-?: K extends keyof T ? Defaults[K] extends undefined ? T[K] : NotUndefined<T[K]> : never;
|
|
1324
1325
|
} & {
|
|
1325
1326
|
readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean;
|
|
1326
1327
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { pauseTracking, resetTracking, isRef, toRaw, getCurrentScope, isShallow as isShallow$1, isReactive, ReactiveEffect, ref, shallowReadonly, track, reactive, shallowReactive, trigger, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, isReadonly } from '@vue/reactivity';
|
|
2
2
|
export { EffectScope, ReactiveEffect, customRef, effect, effectScope, getCurrentScope, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
3
|
-
import { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, looseToNumber, hyphenate, camelize, isObject, isOn, hasOwn, isModelListener, toNumber, hasChanged, remove, isSet, isMap, isPlainObject, isBuiltInDirective, invokeArrayFns, isRegExp,
|
|
3
|
+
import { isString, isFunction, isPromise, isArray, NOOP, getGlobalThis, extend, EMPTY_OBJ, toHandlerKey, looseToNumber, hyphenate, camelize, isObject, isOn, hasOwn, isModelListener, capitalize, toNumber, hasChanged, remove, isSet, isMap, isPlainObject, isBuiltInDirective, invokeArrayFns, isRegExp, isGloballyAllowed, NO, def, isReservedProp, EMPTY_ARR, toRawType, makeMap, normalizeClass, normalizeStyle } from '@vue/shared';
|
|
4
4
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
5
5
|
|
|
6
6
|
const stack = [];
|
|
@@ -817,9 +817,19 @@ function renderComponentRoot(instance) {
|
|
|
817
817
|
try {
|
|
818
818
|
if (vnode.shapeFlag & 4) {
|
|
819
819
|
const proxyToUse = withProxy || proxy;
|
|
820
|
+
const thisProxy = !!(process.env.NODE_ENV !== "production") && setupState.__isScriptSetup ? new Proxy(proxyToUse, {
|
|
821
|
+
get(target, key, receiver) {
|
|
822
|
+
warn(
|
|
823
|
+
`Property '${String(
|
|
824
|
+
key
|
|
825
|
+
)}' was accessed via 'this'. Avoid using 'this' in templates.`
|
|
826
|
+
);
|
|
827
|
+
return Reflect.get(target, key, receiver);
|
|
828
|
+
}
|
|
829
|
+
}) : proxyToUse;
|
|
820
830
|
result = normalizeVNode(
|
|
821
831
|
render.call(
|
|
822
|
-
|
|
832
|
+
thisProxy,
|
|
823
833
|
proxyToUse,
|
|
824
834
|
renderCache,
|
|
825
835
|
props,
|
|
@@ -1054,6 +1064,61 @@ function updateHOCHostEl({ vnode, parent }, el) {
|
|
|
1054
1064
|
}
|
|
1055
1065
|
}
|
|
1056
1066
|
|
|
1067
|
+
const COMPONENTS = "components";
|
|
1068
|
+
const DIRECTIVES = "directives";
|
|
1069
|
+
function resolveComponent(name, maybeSelfReference) {
|
|
1070
|
+
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
1071
|
+
}
|
|
1072
|
+
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
1073
|
+
function resolveDynamicComponent(component) {
|
|
1074
|
+
if (isString(component)) {
|
|
1075
|
+
return resolveAsset(COMPONENTS, component, false) || component;
|
|
1076
|
+
} else {
|
|
1077
|
+
return component || NULL_DYNAMIC_COMPONENT;
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
function resolveDirective(name) {
|
|
1081
|
+
return resolveAsset(DIRECTIVES, name);
|
|
1082
|
+
}
|
|
1083
|
+
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
1084
|
+
const instance = currentRenderingInstance || currentInstance;
|
|
1085
|
+
if (instance) {
|
|
1086
|
+
const Component = instance.type;
|
|
1087
|
+
if (type === COMPONENTS) {
|
|
1088
|
+
const selfName = getComponentName(
|
|
1089
|
+
Component,
|
|
1090
|
+
false
|
|
1091
|
+
/* do not include inferred name to avoid breaking existing code */
|
|
1092
|
+
);
|
|
1093
|
+
if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
|
|
1094
|
+
return Component;
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
const res = (
|
|
1098
|
+
// local registration
|
|
1099
|
+
// check instance[type] first which is resolved for options API
|
|
1100
|
+
resolve(instance[type] || Component[type], name) || // global registration
|
|
1101
|
+
resolve(instance.appContext[type], name)
|
|
1102
|
+
);
|
|
1103
|
+
if (!res && maybeSelfReference) {
|
|
1104
|
+
return Component;
|
|
1105
|
+
}
|
|
1106
|
+
if (!!(process.env.NODE_ENV !== "production") && warnMissing && !res) {
|
|
1107
|
+
const extra = type === COMPONENTS ? `
|
|
1108
|
+
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
|
|
1109
|
+
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
1110
|
+
}
|
|
1111
|
+
return res;
|
|
1112
|
+
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
1113
|
+
warn(
|
|
1114
|
+
`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
|
|
1115
|
+
);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
function resolve(registry, name) {
|
|
1119
|
+
return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1057
1122
|
const isSuspense = (type) => type.__isSuspense;
|
|
1058
1123
|
const SuspenseImpl = {
|
|
1059
1124
|
name: "Suspense",
|
|
@@ -1588,7 +1653,7 @@ function normalizeSuspenseSlot(s) {
|
|
|
1588
1653
|
}
|
|
1589
1654
|
if (isArray(s)) {
|
|
1590
1655
|
const singleChild = filterSingleRoot(s);
|
|
1591
|
-
if (!!(process.env.NODE_ENV !== "production") && !singleChild) {
|
|
1656
|
+
if (!!(process.env.NODE_ENV !== "production") && !singleChild && s.filter((child) => child !== NULL_DYNAMIC_COMPONENT).length > 0) {
|
|
1592
1657
|
warn(`<Suspense> slots expect a single root node.`);
|
|
1593
1658
|
}
|
|
1594
1659
|
s = singleChild;
|
|
@@ -1726,6 +1791,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
1726
1791
|
let onCleanup = (fn) => {
|
|
1727
1792
|
cleanup = effect.onStop = () => {
|
|
1728
1793
|
callWithErrorHandling(fn, instance, 4);
|
|
1794
|
+
cleanup = effect.onStop = void 0;
|
|
1729
1795
|
};
|
|
1730
1796
|
};
|
|
1731
1797
|
let ssrCleanup;
|
|
@@ -2219,7 +2285,11 @@ function emptyPlaceholder(vnode) {
|
|
|
2219
2285
|
}
|
|
2220
2286
|
}
|
|
2221
2287
|
function getKeepAliveChild(vnode) {
|
|
2222
|
-
return isKeepAlive(vnode) ?
|
|
2288
|
+
return isKeepAlive(vnode) ? (
|
|
2289
|
+
// #7121 ensure get the child component subtree in case
|
|
2290
|
+
// it's been replaced during HMR
|
|
2291
|
+
!!(process.env.NODE_ENV !== "production") && vnode.component ? vnode.component.subTree : vnode.children ? vnode.children[0] : void 0
|
|
2292
|
+
) : vnode;
|
|
2223
2293
|
}
|
|
2224
2294
|
function setTransitionHooks(vnode, hooks) {
|
|
2225
2295
|
if (vnode.shapeFlag & 6 && vnode.component) {
|
|
@@ -2702,61 +2772,6 @@ function onErrorCaptured(hook, target = currentInstance) {
|
|
|
2702
2772
|
injectHook("ec", hook, target);
|
|
2703
2773
|
}
|
|
2704
2774
|
|
|
2705
|
-
const COMPONENTS = "components";
|
|
2706
|
-
const DIRECTIVES = "directives";
|
|
2707
|
-
function resolveComponent(name, maybeSelfReference) {
|
|
2708
|
-
return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name;
|
|
2709
|
-
}
|
|
2710
|
-
const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc");
|
|
2711
|
-
function resolveDynamicComponent(component) {
|
|
2712
|
-
if (isString(component)) {
|
|
2713
|
-
return resolveAsset(COMPONENTS, component, false) || component;
|
|
2714
|
-
} else {
|
|
2715
|
-
return component || NULL_DYNAMIC_COMPONENT;
|
|
2716
|
-
}
|
|
2717
|
-
}
|
|
2718
|
-
function resolveDirective(name) {
|
|
2719
|
-
return resolveAsset(DIRECTIVES, name);
|
|
2720
|
-
}
|
|
2721
|
-
function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) {
|
|
2722
|
-
const instance = currentRenderingInstance || currentInstance;
|
|
2723
|
-
if (instance) {
|
|
2724
|
-
const Component = instance.type;
|
|
2725
|
-
if (type === COMPONENTS) {
|
|
2726
|
-
const selfName = getComponentName(
|
|
2727
|
-
Component,
|
|
2728
|
-
false
|
|
2729
|
-
/* do not include inferred name to avoid breaking existing code */
|
|
2730
|
-
);
|
|
2731
|
-
if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize(camelize(name)))) {
|
|
2732
|
-
return Component;
|
|
2733
|
-
}
|
|
2734
|
-
}
|
|
2735
|
-
const res = (
|
|
2736
|
-
// local registration
|
|
2737
|
-
// check instance[type] first which is resolved for options API
|
|
2738
|
-
resolve(instance[type] || Component[type], name) || // global registration
|
|
2739
|
-
resolve(instance.appContext[type], name)
|
|
2740
|
-
);
|
|
2741
|
-
if (!res && maybeSelfReference) {
|
|
2742
|
-
return Component;
|
|
2743
|
-
}
|
|
2744
|
-
if (!!(process.env.NODE_ENV !== "production") && warnMissing && !res) {
|
|
2745
|
-
const extra = type === COMPONENTS ? `
|
|
2746
|
-
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : ``;
|
|
2747
|
-
warn(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
|
|
2748
|
-
}
|
|
2749
|
-
return res;
|
|
2750
|
-
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
2751
|
-
warn(
|
|
2752
|
-
`resolve${capitalize(type.slice(0, -1))} can only be used in render() or setup().`
|
|
2753
|
-
);
|
|
2754
|
-
}
|
|
2755
|
-
}
|
|
2756
|
-
function resolve(registry, name) {
|
|
2757
|
-
return registry && (registry[name] || registry[camelize(name)] || registry[capitalize(camelize(name))]);
|
|
2758
|
-
}
|
|
2759
|
-
|
|
2760
2775
|
function renderList(source, renderItem, cache, index) {
|
|
2761
2776
|
let ret;
|
|
2762
2777
|
const cached = cache && cache[index];
|
|
@@ -4277,6 +4292,9 @@ function assertType(value, type) {
|
|
|
4277
4292
|
};
|
|
4278
4293
|
}
|
|
4279
4294
|
function getInvalidTypeMessage(name, value, expectedTypes) {
|
|
4295
|
+
if (expectedTypes.length === 0) {
|
|
4296
|
+
return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`;
|
|
4297
|
+
}
|
|
4280
4298
|
let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize).join(" | ")}`;
|
|
4281
4299
|
const expectedType = expectedTypes[0];
|
|
4282
4300
|
const receivedType = toRawType(value);
|
|
@@ -4546,6 +4564,20 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4546
4564
|
const { type, ref, shapeFlag, patchFlag } = vnode;
|
|
4547
4565
|
let domType = node.nodeType;
|
|
4548
4566
|
vnode.el = node;
|
|
4567
|
+
if (!!(process.env.NODE_ENV !== "production") || __VUE_PROD_DEVTOOLS__) {
|
|
4568
|
+
if (!("__vnode" in node)) {
|
|
4569
|
+
Object.defineProperty(node, "__vnode", {
|
|
4570
|
+
value: vnode,
|
|
4571
|
+
enumerable: false
|
|
4572
|
+
});
|
|
4573
|
+
}
|
|
4574
|
+
if (!("__vueParentComponent" in node)) {
|
|
4575
|
+
Object.defineProperty(node, "__vueParentComponent", {
|
|
4576
|
+
value: parentComponent,
|
|
4577
|
+
enumerable: false
|
|
4578
|
+
});
|
|
4579
|
+
}
|
|
4580
|
+
}
|
|
4549
4581
|
if (patchFlag === -2) {
|
|
4550
4582
|
optimized = false;
|
|
4551
4583
|
vnode.dynamicChildren = null;
|
|
@@ -4576,15 +4608,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4576
4608
|
}
|
|
4577
4609
|
break;
|
|
4578
4610
|
case Comment:
|
|
4579
|
-
if (
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
|
|
4586
|
-
|
|
4587
|
-
|
|
4611
|
+
if (isTemplateNode(node)) {
|
|
4612
|
+
nextNode = nextSibling(node);
|
|
4613
|
+
replaceNode(
|
|
4614
|
+
vnode.el = node.content.firstChild,
|
|
4615
|
+
node,
|
|
4616
|
+
parentComponent
|
|
4617
|
+
);
|
|
4618
|
+
} else if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
4619
|
+
nextNode = onMismatch();
|
|
4588
4620
|
} else {
|
|
4589
4621
|
nextNode = nextSibling(node);
|
|
4590
4622
|
}
|
|
@@ -4707,15 +4739,16 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4707
4739
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
4708
4740
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
4709
4741
|
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
4710
|
-
const
|
|
4711
|
-
if (!!(process.env.NODE_ENV !== "production") ||
|
|
4742
|
+
const forcePatch = type === "input" || type === "option";
|
|
4743
|
+
if (!!(process.env.NODE_ENV !== "production") || forcePatch || patchFlag !== -1) {
|
|
4712
4744
|
if (dirs) {
|
|
4713
4745
|
invokeDirectiveHook(vnode, null, parentComponent, "created");
|
|
4714
4746
|
}
|
|
4715
4747
|
if (props) {
|
|
4716
|
-
if (
|
|
4748
|
+
if (forcePatch || !optimized || patchFlag & (16 | 32)) {
|
|
4717
4749
|
for (const key in props) {
|
|
4718
|
-
if (
|
|
4750
|
+
if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
|
|
4751
|
+
key[0] === ".") {
|
|
4719
4752
|
patchProp(
|
|
4720
4753
|
el,
|
|
4721
4754
|
key,
|
|
@@ -4928,8 +4961,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4928
4961
|
let parent = parentComponent;
|
|
4929
4962
|
while (parent) {
|
|
4930
4963
|
if (parent.vnode.el === oldNode) {
|
|
4931
|
-
parent.vnode.el = newNode;
|
|
4932
|
-
parent.subTree.el = newNode;
|
|
4964
|
+
parent.vnode.el = parent.subTree.el = newNode;
|
|
4933
4965
|
}
|
|
4934
4966
|
parent = parent.parent;
|
|
4935
4967
|
}
|
|
@@ -6507,6 +6539,7 @@ const resolveTarget = (props, select) => {
|
|
|
6507
6539
|
}
|
|
6508
6540
|
};
|
|
6509
6541
|
const TeleportImpl = {
|
|
6542
|
+
name: "Teleport",
|
|
6510
6543
|
__isTeleport: true,
|
|
6511
6544
|
process(n1, n2, container, anchor, parentComponent, parentSuspense, isSVG, slotScopeIds, optimized, internals) {
|
|
6512
6545
|
const {
|
|
@@ -6928,7 +6961,7 @@ function _createVNode(type, props = null, children = null, patchFlag = 0, dynami
|
|
|
6928
6961
|
if (!!(process.env.NODE_ENV !== "production") && shapeFlag & 4 && isProxy(type)) {
|
|
6929
6962
|
type = toRaw(type);
|
|
6930
6963
|
warn(
|
|
6931
|
-
`Vue received a Component
|
|
6964
|
+
`Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`,
|
|
6932
6965
|
`
|
|
6933
6966
|
Component that was made reactive: `,
|
|
6934
6967
|
type
|
|
@@ -7781,7 +7814,7 @@ function isMemoSame(cached, memo) {
|
|
|
7781
7814
|
return true;
|
|
7782
7815
|
}
|
|
7783
7816
|
|
|
7784
|
-
const version = "3.3.
|
|
7817
|
+
const version = "3.3.9";
|
|
7785
7818
|
const _ssrUtils = {
|
|
7786
7819
|
createComponentInstance,
|
|
7787
7820
|
setupComponent,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.9",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@vue/shared": "3.3.
|
|
36
|
-
"@vue/reactivity": "3.3.
|
|
35
|
+
"@vue/shared": "3.3.9",
|
|
36
|
+
"@vue/reactivity": "3.3.9"
|
|
37
37
|
}
|
|
38
38
|
}
|