@vue/runtime-core 3.2.21 → 3.2.25
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 +142 -107
- package/dist/runtime-core.cjs.prod.js +130 -99
- package/dist/runtime-core.d.ts +41 -6
- package/dist/runtime-core.esm-bundler.js +144 -108
- package/package.json +3 -3
|
@@ -7,6 +7,7 @@ var shared = require('@vue/shared');
|
|
|
7
7
|
|
|
8
8
|
let buffer = [];
|
|
9
9
|
function setDevtoolsHook(hook, target) {
|
|
10
|
+
var _a, _b;
|
|
10
11
|
exports.devtools = hook;
|
|
11
12
|
if (exports.devtools) {
|
|
12
13
|
exports.devtools.enabled = true;
|
|
@@ -19,7 +20,10 @@ function setDevtoolsHook(hook, target) {
|
|
|
19
20
|
// (#4815)
|
|
20
21
|
// eslint-disable-next-line no-restricted-globals
|
|
21
22
|
typeof window !== 'undefined' &&
|
|
22
|
-
|
|
23
|
+
// some envs mock window but not fully
|
|
24
|
+
window.HTMLElement &&
|
|
25
|
+
// also exclude jsdom
|
|
26
|
+
!((_b = (_a = window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) === null || _b === void 0 ? void 0 : _b.includes('jsdom'))) {
|
|
23
27
|
const replay = (target.__VUE_DEVTOOLS_HOOK_REPLAY__ =
|
|
24
28
|
target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []);
|
|
25
29
|
replay.push((newHook) => {
|
|
@@ -1519,7 +1523,7 @@ function registerKeepAliveHook(hook, type, target = currentInstance) {
|
|
|
1519
1523
|
}
|
|
1520
1524
|
current = current.parent;
|
|
1521
1525
|
}
|
|
1522
|
-
hook();
|
|
1526
|
+
return hook();
|
|
1523
1527
|
});
|
|
1524
1528
|
injectHook(type, wrappedHook, target);
|
|
1525
1529
|
// In addition to registering it on the target instance, we walk up the parent
|
|
@@ -2077,7 +2081,7 @@ function setFullProps(instance, rawProps, props, attrs) {
|
|
|
2077
2081
|
}
|
|
2078
2082
|
}
|
|
2079
2083
|
else if (!isEmitListener(instance.emitsOptions, key)) {
|
|
2080
|
-
if (value !== attrs[key]) {
|
|
2084
|
+
if (!(key in attrs) || value !== attrs[key]) {
|
|
2081
2085
|
attrs[key] = value;
|
|
2082
2086
|
hasAttrsChanged = true;
|
|
2083
2087
|
}
|
|
@@ -2500,6 +2504,92 @@ function createAppAPI(render, hydrate) {
|
|
|
2500
2504
|
};
|
|
2501
2505
|
}
|
|
2502
2506
|
|
|
2507
|
+
/**
|
|
2508
|
+
* Function for handling a template ref
|
|
2509
|
+
*/
|
|
2510
|
+
function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
2511
|
+
if (shared.isArray(rawRef)) {
|
|
2512
|
+
rawRef.forEach((r, i) => setRef(r, oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
|
|
2513
|
+
return;
|
|
2514
|
+
}
|
|
2515
|
+
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
2516
|
+
// when mounting async components, nothing needs to be done,
|
|
2517
|
+
// because the template ref is forwarded to inner component
|
|
2518
|
+
return;
|
|
2519
|
+
}
|
|
2520
|
+
const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
|
|
2521
|
+
? getExposeProxy(vnode.component) || vnode.component.proxy
|
|
2522
|
+
: vnode.el;
|
|
2523
|
+
const value = isUnmount ? null : refValue;
|
|
2524
|
+
const { i: owner, r: ref } = rawRef;
|
|
2525
|
+
const oldRef = oldRawRef && oldRawRef.r;
|
|
2526
|
+
const refs = owner.refs === shared.EMPTY_OBJ ? (owner.refs = {}) : owner.refs;
|
|
2527
|
+
const setupState = owner.setupState;
|
|
2528
|
+
// dynamic ref changed. unset old ref
|
|
2529
|
+
if (oldRef != null && oldRef !== ref) {
|
|
2530
|
+
if (shared.isString(oldRef)) {
|
|
2531
|
+
refs[oldRef] = null;
|
|
2532
|
+
if (shared.hasOwn(setupState, oldRef)) {
|
|
2533
|
+
setupState[oldRef] = null;
|
|
2534
|
+
}
|
|
2535
|
+
}
|
|
2536
|
+
else if (reactivity.isRef(oldRef)) {
|
|
2537
|
+
oldRef.value = null;
|
|
2538
|
+
}
|
|
2539
|
+
}
|
|
2540
|
+
if (shared.isFunction(ref)) {
|
|
2541
|
+
callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
|
|
2542
|
+
}
|
|
2543
|
+
else {
|
|
2544
|
+
const _isString = shared.isString(ref);
|
|
2545
|
+
const _isRef = reactivity.isRef(ref);
|
|
2546
|
+
if (_isString || _isRef) {
|
|
2547
|
+
const doSet = () => {
|
|
2548
|
+
if (rawRef.f) {
|
|
2549
|
+
const existing = _isString ? refs[ref] : ref.value;
|
|
2550
|
+
if (isUnmount) {
|
|
2551
|
+
shared.isArray(existing) && shared.remove(existing, refValue);
|
|
2552
|
+
}
|
|
2553
|
+
else {
|
|
2554
|
+
if (!shared.isArray(existing)) {
|
|
2555
|
+
if (_isString) {
|
|
2556
|
+
refs[ref] = [refValue];
|
|
2557
|
+
}
|
|
2558
|
+
else {
|
|
2559
|
+
ref.value = [refValue];
|
|
2560
|
+
if (rawRef.k)
|
|
2561
|
+
refs[rawRef.k] = ref.value;
|
|
2562
|
+
}
|
|
2563
|
+
}
|
|
2564
|
+
else if (!existing.includes(refValue)) {
|
|
2565
|
+
existing.push(refValue);
|
|
2566
|
+
}
|
|
2567
|
+
}
|
|
2568
|
+
}
|
|
2569
|
+
else if (_isString) {
|
|
2570
|
+
refs[ref] = value;
|
|
2571
|
+
if (shared.hasOwn(setupState, ref)) {
|
|
2572
|
+
setupState[ref] = value;
|
|
2573
|
+
}
|
|
2574
|
+
}
|
|
2575
|
+
else if (reactivity.isRef(ref)) {
|
|
2576
|
+
ref.value = value;
|
|
2577
|
+
if (rawRef.k)
|
|
2578
|
+
refs[rawRef.k] = value;
|
|
2579
|
+
}
|
|
2580
|
+
else ;
|
|
2581
|
+
};
|
|
2582
|
+
if (value) {
|
|
2583
|
+
doSet.id = -1;
|
|
2584
|
+
queuePostRenderEffect(doSet, parentSuspense);
|
|
2585
|
+
}
|
|
2586
|
+
else {
|
|
2587
|
+
doSet();
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
}
|
|
2591
|
+
}
|
|
2592
|
+
|
|
2503
2593
|
let hasMismatch = false;
|
|
2504
2594
|
const isSVGContainer = (container) => /svg/.test(container.namespaceURI) && container.tagName !== 'foreignObject';
|
|
2505
2595
|
const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
@@ -3036,12 +3126,15 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3036
3126
|
const oldProps = n1.props || shared.EMPTY_OBJ;
|
|
3037
3127
|
const newProps = n2.props || shared.EMPTY_OBJ;
|
|
3038
3128
|
let vnodeHook;
|
|
3129
|
+
// disable recurse in beforeUpdate hooks
|
|
3130
|
+
parentComponent && toggleRecurse(parentComponent, false);
|
|
3039
3131
|
if ((vnodeHook = newProps.onVnodeBeforeUpdate)) {
|
|
3040
3132
|
invokeVNodeHook(vnodeHook, parentComponent, n2, n1);
|
|
3041
3133
|
}
|
|
3042
3134
|
if (dirs) {
|
|
3043
3135
|
invokeDirectiveHook(n2, n1, parentComponent, 'beforeUpdate');
|
|
3044
3136
|
}
|
|
3137
|
+
parentComponent && toggleRecurse(parentComponent, true);
|
|
3045
3138
|
const areChildrenSVG = isSVG && n2.type !== 'foreignObject';
|
|
3046
3139
|
if (dynamicChildren) {
|
|
3047
3140
|
patchBlockChildren(n1.dynamicChildren, dynamicChildren, el, parentComponent, parentSuspense, areChildrenSVG, slotScopeIds);
|
|
@@ -3278,7 +3371,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3278
3371
|
const { el, props } = initialVNode;
|
|
3279
3372
|
const { bm, m, parent } = instance;
|
|
3280
3373
|
const isAsyncWrapperVNode = isAsyncWrapper(initialVNode);
|
|
3281
|
-
|
|
3374
|
+
toggleRecurse(instance, false);
|
|
3282
3375
|
// beforeMount hook
|
|
3283
3376
|
if (bm) {
|
|
3284
3377
|
shared.invokeArrayFns(bm);
|
|
@@ -3288,7 +3381,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3288
3381
|
(vnodeHook = props && props.onVnodeBeforeMount)) {
|
|
3289
3382
|
invokeVNodeHook(vnodeHook, parent, initialVNode);
|
|
3290
3383
|
}
|
|
3291
|
-
|
|
3384
|
+
toggleRecurse(instance, true);
|
|
3292
3385
|
if (el && hydrateNode) {
|
|
3293
3386
|
// vnode has adopted host node - perform hydration instead of mount.
|
|
3294
3387
|
const hydrateSubTree = () => {
|
|
@@ -3340,7 +3433,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3340
3433
|
let originNext = next;
|
|
3341
3434
|
let vnodeHook;
|
|
3342
3435
|
// Disallow component effect recursion during pre-lifecycle hooks.
|
|
3343
|
-
|
|
3436
|
+
toggleRecurse(instance, false);
|
|
3344
3437
|
if (next) {
|
|
3345
3438
|
next.el = vnode.el;
|
|
3346
3439
|
updateComponentPreRender(instance, next, optimized);
|
|
@@ -3356,7 +3449,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3356
3449
|
if ((vnodeHook = next.props && next.props.onVnodeBeforeUpdate)) {
|
|
3357
3450
|
invokeVNodeHook(vnodeHook, parent, next, vnode);
|
|
3358
3451
|
}
|
|
3359
|
-
|
|
3452
|
+
toggleRecurse(instance, true);
|
|
3360
3453
|
const nextTree = renderComponentRoot(instance);
|
|
3361
3454
|
const prevTree = instance.subTree;
|
|
3362
3455
|
instance.subTree = nextTree;
|
|
@@ -3383,13 +3476,13 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3383
3476
|
}
|
|
3384
3477
|
};
|
|
3385
3478
|
// create reactive effect for rendering
|
|
3386
|
-
const effect = new reactivity.ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope
|
|
3387
|
-
);
|
|
3479
|
+
const effect = (instance.effect = new reactivity.ReactiveEffect(componentUpdateFn, () => queueJob(instance.update), instance.scope // track it in component's effect scope
|
|
3480
|
+
));
|
|
3388
3481
|
const update = (instance.update = effect.run.bind(effect));
|
|
3389
3482
|
update.id = instance.uid;
|
|
3390
3483
|
// allowRecurse
|
|
3391
3484
|
// #1801, #2043 component render effects should allow recursive updates
|
|
3392
|
-
|
|
3485
|
+
toggleRecurse(instance, true);
|
|
3393
3486
|
update();
|
|
3394
3487
|
};
|
|
3395
3488
|
const updateComponentPreRender = (instance, nextVNode, optimized) => {
|
|
@@ -3894,78 +3987,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
3894
3987
|
createApp: createAppAPI(render, hydrate)
|
|
3895
3988
|
};
|
|
3896
3989
|
}
|
|
3897
|
-
function
|
|
3898
|
-
|
|
3899
|
-
rawRef.forEach((r, i) => setRef(r, oldRawRef && (shared.isArray(oldRawRef) ? oldRawRef[i] : oldRawRef), parentSuspense, vnode, isUnmount));
|
|
3900
|
-
return;
|
|
3901
|
-
}
|
|
3902
|
-
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
3903
|
-
// when mounting async components, nothing needs to be done,
|
|
3904
|
-
// because the template ref is forwarded to inner component
|
|
3905
|
-
return;
|
|
3906
|
-
}
|
|
3907
|
-
const refValue = vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */
|
|
3908
|
-
? getExposeProxy(vnode.component) || vnode.component.proxy
|
|
3909
|
-
: vnode.el;
|
|
3910
|
-
const value = isUnmount ? null : refValue;
|
|
3911
|
-
const { i: owner, r: ref } = rawRef;
|
|
3912
|
-
const oldRef = oldRawRef && oldRawRef.r;
|
|
3913
|
-
const refs = owner.refs === shared.EMPTY_OBJ ? (owner.refs = {}) : owner.refs;
|
|
3914
|
-
const setupState = owner.setupState;
|
|
3915
|
-
// dynamic ref changed. unset old ref
|
|
3916
|
-
if (oldRef != null && oldRef !== ref) {
|
|
3917
|
-
if (shared.isString(oldRef)) {
|
|
3918
|
-
refs[oldRef] = null;
|
|
3919
|
-
if (shared.hasOwn(setupState, oldRef)) {
|
|
3920
|
-
setupState[oldRef] = null;
|
|
3921
|
-
}
|
|
3922
|
-
}
|
|
3923
|
-
else if (reactivity.isRef(oldRef)) {
|
|
3924
|
-
oldRef.value = null;
|
|
3925
|
-
}
|
|
3926
|
-
}
|
|
3927
|
-
if (shared.isString(ref)) {
|
|
3928
|
-
const doSet = () => {
|
|
3929
|
-
{
|
|
3930
|
-
refs[ref] = value;
|
|
3931
|
-
}
|
|
3932
|
-
if (shared.hasOwn(setupState, ref)) {
|
|
3933
|
-
setupState[ref] = value;
|
|
3934
|
-
}
|
|
3935
|
-
};
|
|
3936
|
-
// #1789: for non-null values, set them after render
|
|
3937
|
-
// null values means this is unmount and it should not overwrite another
|
|
3938
|
-
// ref with the same key
|
|
3939
|
-
if (value) {
|
|
3940
|
-
doSet.id = -1;
|
|
3941
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
3942
|
-
}
|
|
3943
|
-
else {
|
|
3944
|
-
doSet();
|
|
3945
|
-
}
|
|
3946
|
-
}
|
|
3947
|
-
else if (reactivity.isRef(ref)) {
|
|
3948
|
-
const doSet = () => {
|
|
3949
|
-
ref.value = value;
|
|
3950
|
-
};
|
|
3951
|
-
if (value) {
|
|
3952
|
-
doSet.id = -1;
|
|
3953
|
-
queuePostRenderEffect(doSet, parentSuspense);
|
|
3954
|
-
}
|
|
3955
|
-
else {
|
|
3956
|
-
doSet();
|
|
3957
|
-
}
|
|
3958
|
-
}
|
|
3959
|
-
else if (shared.isFunction(ref)) {
|
|
3960
|
-
callWithErrorHandling(ref, owner, 12 /* FUNCTION_REF */, [value, refs]);
|
|
3961
|
-
}
|
|
3962
|
-
else ;
|
|
3963
|
-
}
|
|
3964
|
-
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
3965
|
-
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
3966
|
-
vnode,
|
|
3967
|
-
prevVNode
|
|
3968
|
-
]);
|
|
3990
|
+
function toggleRecurse({ effect, update }, allowed) {
|
|
3991
|
+
effect.allowRecurse = update.allowRecurse = allowed;
|
|
3969
3992
|
}
|
|
3970
3993
|
/**
|
|
3971
3994
|
* #1156
|
|
@@ -3975,8 +3998,8 @@ function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
|
3975
3998
|
*
|
|
3976
3999
|
* #2080
|
|
3977
4000
|
* Inside keyed `template` fragment static children, if a fragment is moved,
|
|
3978
|
-
* the children will always moved
|
|
3979
|
-
*
|
|
4001
|
+
* the children will always be moved. Therefore, in order to ensure correct move
|
|
4002
|
+
* position, el should be inherited from previous nodes.
|
|
3980
4003
|
*/
|
|
3981
4004
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
3982
4005
|
const ch1 = n1.children;
|
|
@@ -4371,10 +4394,10 @@ function transformVNodeArgs(transformer) {
|
|
|
4371
4394
|
}
|
|
4372
4395
|
const InternalObjectKey = `__vInternal`;
|
|
4373
4396
|
const normalizeKey = ({ key }) => key != null ? key : null;
|
|
4374
|
-
const normalizeRef = ({ ref }) => {
|
|
4397
|
+
const normalizeRef = ({ ref, ref_key, ref_for }) => {
|
|
4375
4398
|
return (ref != null
|
|
4376
4399
|
? shared.isString(ref) || reactivity.isRef(ref) || shared.isFunction(ref)
|
|
4377
|
-
? { i: currentRenderingInstance, r: ref }
|
|
4400
|
+
? { i: currentRenderingInstance, r: ref, k: ref_key, f: !!ref_for }
|
|
4378
4401
|
: ref
|
|
4379
4402
|
: null);
|
|
4380
4403
|
};
|
|
@@ -4676,7 +4699,8 @@ function mergeProps(...args) {
|
|
|
4676
4699
|
else if (shared.isOn(key)) {
|
|
4677
4700
|
const existing = ret[key];
|
|
4678
4701
|
const incoming = toMerge[key];
|
|
4679
|
-
if (existing !== incoming
|
|
4702
|
+
if (existing !== incoming &&
|
|
4703
|
+
!(shared.isArray(existing) && existing.includes(incoming))) {
|
|
4680
4704
|
ret[key] = existing
|
|
4681
4705
|
? [].concat(existing, incoming)
|
|
4682
4706
|
: incoming;
|
|
@@ -4688,6 +4712,12 @@ function mergeProps(...args) {
|
|
|
4688
4712
|
}
|
|
4689
4713
|
}
|
|
4690
4714
|
return ret;
|
|
4715
|
+
}
|
|
4716
|
+
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
4717
|
+
callWithAsyncErrorHandling(hook, instance, 7 /* VNODE_HOOK */, [
|
|
4718
|
+
vnode,
|
|
4719
|
+
prevVNode
|
|
4720
|
+
]);
|
|
4691
4721
|
}
|
|
4692
4722
|
|
|
4693
4723
|
/**
|
|
@@ -4852,23 +4882,23 @@ const PublicInstanceProxyHandlers = {
|
|
|
4852
4882
|
const n = accessCache[key];
|
|
4853
4883
|
if (n !== undefined) {
|
|
4854
4884
|
switch (n) {
|
|
4855
|
-
case
|
|
4885
|
+
case 1 /* SETUP */:
|
|
4856
4886
|
return setupState[key];
|
|
4857
|
-
case
|
|
4887
|
+
case 2 /* DATA */:
|
|
4858
4888
|
return data[key];
|
|
4859
|
-
case
|
|
4889
|
+
case 4 /* CONTEXT */:
|
|
4860
4890
|
return ctx[key];
|
|
4861
|
-
case
|
|
4891
|
+
case 3 /* PROPS */:
|
|
4862
4892
|
return props[key];
|
|
4863
4893
|
// default: just fallthrough
|
|
4864
4894
|
}
|
|
4865
4895
|
}
|
|
4866
4896
|
else if (setupState !== shared.EMPTY_OBJ && shared.hasOwn(setupState, key)) {
|
|
4867
|
-
accessCache[key] =
|
|
4897
|
+
accessCache[key] = 1 /* SETUP */;
|
|
4868
4898
|
return setupState[key];
|
|
4869
4899
|
}
|
|
4870
4900
|
else if (data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) {
|
|
4871
|
-
accessCache[key] =
|
|
4901
|
+
accessCache[key] = 2 /* DATA */;
|
|
4872
4902
|
return data[key];
|
|
4873
4903
|
}
|
|
4874
4904
|
else if (
|
|
@@ -4876,15 +4906,15 @@ const PublicInstanceProxyHandlers = {
|
|
|
4876
4906
|
// props
|
|
4877
4907
|
(normalizedProps = instance.propsOptions[0]) &&
|
|
4878
4908
|
shared.hasOwn(normalizedProps, key)) {
|
|
4879
|
-
accessCache[key] =
|
|
4909
|
+
accessCache[key] = 3 /* PROPS */;
|
|
4880
4910
|
return props[key];
|
|
4881
4911
|
}
|
|
4882
4912
|
else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
|
|
4883
|
-
accessCache[key] =
|
|
4913
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
4884
4914
|
return ctx[key];
|
|
4885
4915
|
}
|
|
4886
4916
|
else if (shouldCacheAccess) {
|
|
4887
|
-
accessCache[key] =
|
|
4917
|
+
accessCache[key] = 0 /* OTHER */;
|
|
4888
4918
|
}
|
|
4889
4919
|
}
|
|
4890
4920
|
const publicGetter = publicPropertiesMap[key];
|
|
@@ -4904,7 +4934,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
4904
4934
|
}
|
|
4905
4935
|
else if (ctx !== shared.EMPTY_OBJ && shared.hasOwn(ctx, key)) {
|
|
4906
4936
|
// user may set custom properties to `this` that start with `$`
|
|
4907
|
-
accessCache[key] =
|
|
4937
|
+
accessCache[key] = 4 /* CONTEXT */;
|
|
4908
4938
|
return ctx[key];
|
|
4909
4939
|
}
|
|
4910
4940
|
else if (
|
|
@@ -4940,7 +4970,7 @@ const PublicInstanceProxyHandlers = {
|
|
|
4940
4970
|
},
|
|
4941
4971
|
has({ _: { data, setupState, accessCache, ctx, appContext, propsOptions } }, key) {
|
|
4942
4972
|
let normalizedProps;
|
|
4943
|
-
return (accessCache[key]
|
|
4973
|
+
return (!!accessCache[key] ||
|
|
4944
4974
|
(data !== shared.EMPTY_OBJ && shared.hasOwn(data, key)) ||
|
|
4945
4975
|
(setupState !== shared.EMPTY_OBJ && shared.hasOwn(setupState, key)) ||
|
|
4946
4976
|
((normalizedProps = propsOptions[0]) && shared.hasOwn(normalizedProps, key)) ||
|
|
@@ -4978,6 +5008,7 @@ function createComponentInstance(vnode, parent, suspense) {
|
|
|
4978
5008
|
root: null,
|
|
4979
5009
|
next: null,
|
|
4980
5010
|
subTree: null,
|
|
5011
|
+
effect: null,
|
|
4981
5012
|
update: null,
|
|
4982
5013
|
scope: new reactivity.EffectScope(true /* detached */),
|
|
4983
5014
|
render: null,
|
|
@@ -6030,7 +6061,7 @@ function isMemoSame(cached, memo) {
|
|
|
6030
6061
|
}
|
|
6031
6062
|
|
|
6032
6063
|
// Core API ------------------------------------------------------------------
|
|
6033
|
-
const version = "3.2.
|
|
6064
|
+
const version = "3.2.25";
|
|
6034
6065
|
const _ssrUtils = {
|
|
6035
6066
|
createComponentInstance,
|
|
6036
6067
|
setupComponent,
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -4,11 +4,15 @@ import { ComponentPropsOptions as ComponentPropsOptions_2 } from '@vue/runtime-c
|
|
|
4
4
|
import { computed } from '@vue/reactivity';
|
|
5
5
|
import { ComputedGetter } from '@vue/reactivity';
|
|
6
6
|
import { ComputedRef } from '@vue/reactivity';
|
|
7
|
+
import { ComputedSetter } from '@vue/reactivity';
|
|
7
8
|
import { customRef } from '@vue/reactivity';
|
|
9
|
+
import { CustomRefFactory } from '@vue/reactivity';
|
|
8
10
|
import { DebuggerEvent } from '@vue/reactivity';
|
|
11
|
+
import { DebuggerEventExtraInfo } from '@vue/reactivity';
|
|
9
12
|
import { DebuggerOptions } from '@vue/reactivity';
|
|
10
13
|
import { DeepReadonly } from '@vue/reactivity';
|
|
11
14
|
import { effect } from '@vue/reactivity';
|
|
15
|
+
import { EffectScheduler } from '@vue/reactivity';
|
|
12
16
|
import { EffectScope } from '@vue/reactivity';
|
|
13
17
|
import { effectScope } from '@vue/reactivity';
|
|
14
18
|
import { getCurrentScope } from '@vue/reactivity';
|
|
@@ -25,6 +29,7 @@ import { proxyRefs } from '@vue/reactivity';
|
|
|
25
29
|
import { reactive } from '@vue/reactivity';
|
|
26
30
|
import { ReactiveEffect } from '@vue/reactivity';
|
|
27
31
|
import { ReactiveEffectOptions } from '@vue/reactivity';
|
|
32
|
+
import { ReactiveEffectRunner } from '@vue/reactivity';
|
|
28
33
|
import { ReactiveFlags } from '@vue/reactivity';
|
|
29
34
|
import { readonly } from '@vue/reactivity';
|
|
30
35
|
import { Ref } from '@vue/reactivity';
|
|
@@ -32,6 +37,7 @@ import { ref } from '@vue/reactivity';
|
|
|
32
37
|
import { ShallowReactive } from '@vue/reactivity';
|
|
33
38
|
import { shallowReactive } from '@vue/reactivity';
|
|
34
39
|
import { shallowReadonly } from '@vue/reactivity';
|
|
40
|
+
import { ShallowRef } from '@vue/reactivity';
|
|
35
41
|
import { shallowRef } from '@vue/reactivity';
|
|
36
42
|
import { ShallowUnwrapRef } from '@vue/reactivity';
|
|
37
43
|
import { ShapeFlags } from '@vue/shared';
|
|
@@ -95,7 +101,7 @@ export declare interface AppConfig {
|
|
|
95
101
|
errorHandler?: (err: unknown, instance: ComponentPublicInstance | null, info: string) => void;
|
|
96
102
|
warnHandler?: (msg: string, instance: ComponentPublicInstance | null, trace: string) => void;
|
|
97
103
|
/**
|
|
98
|
-
* Options to pass to
|
|
104
|
+
* Options to pass to `@vue/compiler-dom`.
|
|
99
105
|
* Only supported in runtime compiler build.
|
|
100
106
|
*/
|
|
101
107
|
compilerOptions: RuntimeCompilerOptions;
|
|
@@ -224,7 +230,7 @@ export declare type CompatVue = Pick<App, 'version' | 'component' | 'directive'>
|
|
|
224
230
|
directive(name: string, directive: Directive): CompatVue;
|
|
225
231
|
compile(template: string): RenderFunction;
|
|
226
232
|
/**
|
|
227
|
-
* @deprecated
|
|
233
|
+
* @deprecated Vue 3 no longer supports extending constructors.
|
|
228
234
|
*/
|
|
229
235
|
extend: (options?: ComponentOptions) => CompatVue;
|
|
230
236
|
/**
|
|
@@ -334,6 +340,10 @@ export declare interface ComponentInternalInstance {
|
|
|
334
340
|
* Root vnode of this component's own vdom tree
|
|
335
341
|
*/
|
|
336
342
|
subTree: VNode;
|
|
343
|
+
/**
|
|
344
|
+
* Render effect instance
|
|
345
|
+
*/
|
|
346
|
+
effect: ReactiveEffect;
|
|
337
347
|
/**
|
|
338
348
|
* Bound effect runner to be passed to schedulers
|
|
339
349
|
*/
|
|
@@ -491,10 +501,14 @@ declare type ComponentWatchOptions = Record<string, ComponentWatchOptionItem>;
|
|
|
491
501
|
|
|
492
502
|
export { computed }
|
|
493
503
|
|
|
504
|
+
export { ComputedGetter }
|
|
505
|
+
|
|
494
506
|
export declare type ComputedOptions = Record<string, ComputedGetter<any> | WritableComputedOptions<any>>;
|
|
495
507
|
|
|
496
508
|
export { ComputedRef }
|
|
497
509
|
|
|
510
|
+
export { ComputedSetter }
|
|
511
|
+
|
|
498
512
|
/**
|
|
499
513
|
* Concrete component type matches its actual value: it's either an options
|
|
500
514
|
* object, or a function. Use this where the code expects to work with actual
|
|
@@ -594,10 +608,14 @@ declare function _createVNode(type: VNodeTypes | ClassComponent | typeof NULL_DY
|
|
|
594
608
|
|
|
595
609
|
export { customRef }
|
|
596
610
|
|
|
611
|
+
export { CustomRefFactory }
|
|
612
|
+
|
|
597
613
|
declare type Data = Record<string, unknown>;
|
|
598
614
|
|
|
599
615
|
export { DebuggerEvent }
|
|
600
616
|
|
|
617
|
+
export { DebuggerEventExtraInfo }
|
|
618
|
+
|
|
601
619
|
declare type DebuggerHook = (e: DebuggerEvent) => void;
|
|
602
620
|
|
|
603
621
|
export { DebuggerOptions }
|
|
@@ -674,7 +692,7 @@ export declare function defineEmits<TypeEmit>(): TypeEmit;
|
|
|
674
692
|
* This is only usable inside `<script setup>`, is compiled away in the
|
|
675
693
|
* output and should **not** be actually called at runtime.
|
|
676
694
|
*/
|
|
677
|
-
export declare function defineExpose
|
|
695
|
+
export declare function defineExpose<Exposed extends Record<string, any> = Record<string, any>>(exposed?: Exposed): void;
|
|
678
696
|
|
|
679
697
|
/**
|
|
680
698
|
* Vue `<script setup>` compiler macro for declaring component props. The
|
|
@@ -745,7 +763,6 @@ export declare const enum DeprecationTypes {
|
|
|
745
763
|
OPTIONS_DESTROYED = "OPTIONS_DESTROYED",
|
|
746
764
|
WATCH_ARRAY = "WATCH_ARRAY",
|
|
747
765
|
PROPS_DEFAULT_THIS = "PROPS_DEFAULT_THIS",
|
|
748
|
-
V_FOR_REF = "V_FOR_REF",
|
|
749
766
|
V_ON_KEYCODE_MODIFIER = "V_ON_KEYCODE_MODIFIER",
|
|
750
767
|
CUSTOM_DIR = "CUSTOM_DIR",
|
|
751
768
|
ATTR_FALSE_VALUE = "ATTR_FALSE_VALUE",
|
|
@@ -790,6 +807,8 @@ declare type DirectiveModifiers = Record<string, boolean>;
|
|
|
790
807
|
|
|
791
808
|
export { effect }
|
|
792
809
|
|
|
810
|
+
export { EffectScheduler }
|
|
811
|
+
|
|
793
812
|
export { EffectScope }
|
|
794
813
|
|
|
795
814
|
export { effectScope }
|
|
@@ -877,6 +896,7 @@ export declare interface FunctionalComponent<P = {}, E extends EmitsOptions = {}
|
|
|
877
896
|
emits?: E | (keyof E)[];
|
|
878
897
|
inheritAttrs?: boolean;
|
|
879
898
|
displayName?: string;
|
|
899
|
+
compatConfig?: CompatConfig;
|
|
880
900
|
}
|
|
881
901
|
|
|
882
902
|
export declare type FunctionDirective<T = any, V = any> = DirectiveHook<T, any, V>;
|
|
@@ -945,8 +965,12 @@ export declare interface HydrationRenderer extends Renderer<Element | ShadowRoot
|
|
|
945
965
|
hydrate: RootHydrateFunction;
|
|
946
966
|
}
|
|
947
967
|
|
|
968
|
+
declare type IfAny<T, Y, N> = 0 extends (1 & T) ? Y : N;
|
|
969
|
+
|
|
970
|
+
declare type InferDefault<P, T> = T extends null | number | string | boolean | symbol | Function ? T : (props: P) => T;
|
|
971
|
+
|
|
948
972
|
declare type InferDefaults<T> = {
|
|
949
|
-
[K in keyof T]?:
|
|
973
|
+
[K in keyof T]?: InferDefault<T, NotUndefined<T[K]>>;
|
|
950
974
|
};
|
|
951
975
|
|
|
952
976
|
declare type InferPropType<T> = [T] extends [null] ? any : [T] extends [{
|
|
@@ -959,7 +983,7 @@ declare type InferPropType<T> = [T] extends [null] ? any : [T] extends [{
|
|
|
959
983
|
type: DateConstructor;
|
|
960
984
|
}] ? Date : [T] extends [(infer U)[] | {
|
|
961
985
|
type: (infer U)[];
|
|
962
|
-
}] ? U extends DateConstructor ? Date | InferPropType<U> : InferPropType<U> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? D : V : T;
|
|
986
|
+
}] ? U extends DateConstructor ? Date | InferPropType<U> : InferPropType<U> : [T] extends [Prop<infer V, infer D>] ? unknown extends V ? IfAny<V, V, D> : V : T;
|
|
963
987
|
|
|
964
988
|
export declare function initCustomFormatter(): void;
|
|
965
989
|
|
|
@@ -1376,6 +1400,10 @@ export { ReactiveEffect }
|
|
|
1376
1400
|
|
|
1377
1401
|
export { ReactiveEffectOptions }
|
|
1378
1402
|
|
|
1403
|
+
export { ReactiveEffectRunner }
|
|
1404
|
+
|
|
1405
|
+
export { ReactiveFlags }
|
|
1406
|
+
|
|
1379
1407
|
export { readonly }
|
|
1380
1408
|
|
|
1381
1409
|
export { Ref }
|
|
@@ -1602,6 +1630,8 @@ export { shallowReactive }
|
|
|
1602
1630
|
|
|
1603
1631
|
export { shallowReadonly }
|
|
1604
1632
|
|
|
1633
|
+
export { ShallowRef }
|
|
1634
|
+
|
|
1605
1635
|
export { shallowRef }
|
|
1606
1636
|
|
|
1607
1637
|
export { ShallowUnwrapRef }
|
|
@@ -1768,6 +1798,8 @@ export { unref }
|
|
|
1768
1798
|
|
|
1769
1799
|
declare type UnwrapMixinsType<T, Type extends OptionTypesKeys> = T extends OptionTypesType ? T[Type] : never;
|
|
1770
1800
|
|
|
1801
|
+
export { UnwrapNestedRefs }
|
|
1802
|
+
|
|
1771
1803
|
export { UnwrapRef }
|
|
1772
1804
|
|
|
1773
1805
|
export declare function useAttrs(): SetupContext['attrs'];
|
|
@@ -1834,12 +1866,15 @@ declare type VNodeNormalizedRef = VNodeNormalizedRefAtom | VNodeNormalizedRefAto
|
|
|
1834
1866
|
declare type VNodeNormalizedRefAtom = {
|
|
1835
1867
|
i: ComponentInternalInstance;
|
|
1836
1868
|
r: VNodeRef;
|
|
1869
|
+
k?: string;
|
|
1837
1870
|
f?: boolean;
|
|
1838
1871
|
};
|
|
1839
1872
|
|
|
1840
1873
|
export declare type VNodeProps = {
|
|
1841
1874
|
key?: string | number | symbol;
|
|
1842
1875
|
ref?: VNodeRef;
|
|
1876
|
+
ref_for?: boolean;
|
|
1877
|
+
ref_key?: string;
|
|
1843
1878
|
onVnodeBeforeMount?: VNodeMountHook | VNodeMountHook[];
|
|
1844
1879
|
onVnodeMounted?: VNodeMountHook | VNodeMountHook[];
|
|
1845
1880
|
onVnodeBeforeUpdate?: VNodeUpdateHook | VNodeUpdateHook[];
|