@vue/runtime-dom 3.2.31 → 3.2.32
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.
|
@@ -348,8 +348,17 @@ function warn(msg, ...args) {
|
|
|
348
348
|
let activeEffectScope;
|
|
349
349
|
class EffectScope {
|
|
350
350
|
constructor(detached = false) {
|
|
351
|
+
/**
|
|
352
|
+
* @internal
|
|
353
|
+
*/
|
|
351
354
|
this.active = true;
|
|
355
|
+
/**
|
|
356
|
+
* @internal
|
|
357
|
+
*/
|
|
352
358
|
this.effects = [];
|
|
359
|
+
/**
|
|
360
|
+
* @internal
|
|
361
|
+
*/
|
|
353
362
|
this.cleanups = [];
|
|
354
363
|
if (!detached && activeEffectScope) {
|
|
355
364
|
this.parent = activeEffectScope;
|
|
@@ -359,21 +368,30 @@ class EffectScope {
|
|
|
359
368
|
}
|
|
360
369
|
run(fn) {
|
|
361
370
|
if (this.active) {
|
|
371
|
+
const currentEffectScope = activeEffectScope;
|
|
362
372
|
try {
|
|
363
373
|
activeEffectScope = this;
|
|
364
374
|
return fn();
|
|
365
375
|
}
|
|
366
376
|
finally {
|
|
367
|
-
activeEffectScope =
|
|
377
|
+
activeEffectScope = currentEffectScope;
|
|
368
378
|
}
|
|
369
379
|
}
|
|
370
380
|
else {
|
|
371
381
|
warn(`cannot run an inactive effect scope.`);
|
|
372
382
|
}
|
|
373
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* This should only be called on non-detached scopes
|
|
386
|
+
* @internal
|
|
387
|
+
*/
|
|
374
388
|
on() {
|
|
375
389
|
activeEffectScope = this;
|
|
376
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* This should only be called on non-detached scopes
|
|
393
|
+
* @internal
|
|
394
|
+
*/
|
|
377
395
|
off() {
|
|
378
396
|
activeEffectScope = this.parent;
|
|
379
397
|
}
|
|
@@ -597,9 +615,7 @@ function trackEffects(dep, debuggerEventExtraInfo) {
|
|
|
597
615
|
dep.add(activeEffect);
|
|
598
616
|
activeEffect.deps.push(dep);
|
|
599
617
|
if (activeEffect.onTrack) {
|
|
600
|
-
activeEffect.onTrack(Object.assign({
|
|
601
|
-
effect: activeEffect
|
|
602
|
-
}, debuggerEventExtraInfo));
|
|
618
|
+
activeEffect.onTrack(Object.assign({ effect: activeEffect }, debuggerEventExtraInfo));
|
|
603
619
|
}
|
|
604
620
|
}
|
|
605
621
|
}
|
|
@@ -3084,12 +3100,10 @@ function watchEffect(effect, options) {
|
|
|
3084
3100
|
return doWatch(effect, null, options);
|
|
3085
3101
|
}
|
|
3086
3102
|
function watchPostEffect(effect, options) {
|
|
3087
|
-
return doWatch(effect, null, (Object.assign(
|
|
3088
|
-
));
|
|
3103
|
+
return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'post' }) ));
|
|
3089
3104
|
}
|
|
3090
3105
|
function watchSyncEffect(effect, options) {
|
|
3091
|
-
return doWatch(effect, null, (Object.assign(
|
|
3092
|
-
));
|
|
3106
|
+
return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'sync' }) ));
|
|
3093
3107
|
}
|
|
3094
3108
|
// initial value for watchers to trigger on undefined initial values
|
|
3095
3109
|
const INITIAL_WATCHER_VALUE = {};
|
|
@@ -3386,7 +3400,9 @@ const BaseTransitionImpl = {
|
|
|
3386
3400
|
const { mode } = rawProps;
|
|
3387
3401
|
// check mode
|
|
3388
3402
|
if (mode &&
|
|
3389
|
-
mode !== 'in-out' &&
|
|
3403
|
+
mode !== 'in-out' &&
|
|
3404
|
+
mode !== 'out-in' &&
|
|
3405
|
+
mode !== 'default') {
|
|
3390
3406
|
warn$1(`invalid <transition> mode: ${mode}`);
|
|
3391
3407
|
}
|
|
3392
3408
|
// at this point children has a guaranteed length of 1.
|
|
@@ -3613,20 +3629,24 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
3613
3629
|
vnode.transition = hooks;
|
|
3614
3630
|
}
|
|
3615
3631
|
}
|
|
3616
|
-
function getTransitionRawChildren(children, keepComment = false) {
|
|
3632
|
+
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
3617
3633
|
let ret = [];
|
|
3618
3634
|
let keyedFragmentCount = 0;
|
|
3619
3635
|
for (let i = 0; i < children.length; i++) {
|
|
3620
|
-
|
|
3636
|
+
let child = children[i];
|
|
3637
|
+
// #5360 inherit parent key in case of <template v-for>
|
|
3638
|
+
const key = parentKey == null
|
|
3639
|
+
? child.key
|
|
3640
|
+
: String(parentKey) + String(child.key != null ? child.key : i);
|
|
3621
3641
|
// handle fragment children case, e.g. v-for
|
|
3622
3642
|
if (child.type === Fragment) {
|
|
3623
3643
|
if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
|
|
3624
3644
|
keyedFragmentCount++;
|
|
3625
|
-
ret = ret.concat(getTransitionRawChildren(child.children, keepComment));
|
|
3645
|
+
ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
|
|
3626
3646
|
}
|
|
3627
3647
|
// comment placeholders should be skipped, e.g. v-if
|
|
3628
3648
|
else if (keepComment || child.type !== Comment) {
|
|
3629
|
-
ret.push(child);
|
|
3649
|
+
ret.push(key != null ? cloneVNode(child, { key }) : child);
|
|
3630
3650
|
}
|
|
3631
3651
|
}
|
|
3632
3652
|
// #1126 if a transition children list contains multiple sub fragments, these
|
|
@@ -4592,6 +4612,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4592
4612
|
const propsToUpdate = instance.vnode.dynamicProps;
|
|
4593
4613
|
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
4594
4614
|
let key = propsToUpdate[i];
|
|
4615
|
+
// skip if the prop key is a declared emit event listener
|
|
4616
|
+
if (isEmitListener(instance.emitsOptions, key)) {
|
|
4617
|
+
continue;
|
|
4618
|
+
}
|
|
4595
4619
|
// PROPS flag guarantees rawProps to be non-null
|
|
4596
4620
|
const value = rawProps[key];
|
|
4597
4621
|
if (options) {
|
|
@@ -5116,7 +5140,8 @@ function withDirectives(vnode, directives) {
|
|
|
5116
5140
|
warn$1(`withDirectives can only be used inside render functions.`);
|
|
5117
5141
|
return vnode;
|
|
5118
5142
|
}
|
|
5119
|
-
const instance = internalInstance
|
|
5143
|
+
const instance = getExposeProxy(internalInstance) ||
|
|
5144
|
+
internalInstance.proxy;
|
|
5120
5145
|
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
5121
5146
|
for (let i = 0; i < directives.length; i++) {
|
|
5122
5147
|
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
|
|
@@ -5188,6 +5213,9 @@ function createAppContext() {
|
|
|
5188
5213
|
let uid = 0;
|
|
5189
5214
|
function createAppAPI(render, hydrate) {
|
|
5190
5215
|
return function createApp(rootComponent, rootProps = null) {
|
|
5216
|
+
if (!isFunction(rootComponent)) {
|
|
5217
|
+
rootComponent = Object.assign({}, rootComponent);
|
|
5218
|
+
}
|
|
5191
5219
|
if (rootProps != null && !isObject(rootProps)) {
|
|
5192
5220
|
warn$1(`root props passed to app.mount() must be an object.`);
|
|
5193
5221
|
rootProps = null;
|
|
@@ -5384,6 +5412,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
5384
5412
|
if (!isArray(existing)) {
|
|
5385
5413
|
if (_isString) {
|
|
5386
5414
|
refs[ref] = [refValue];
|
|
5415
|
+
if (hasOwn(setupState, ref)) {
|
|
5416
|
+
setupState[ref] = refs[ref];
|
|
5417
|
+
}
|
|
5387
5418
|
}
|
|
5388
5419
|
else {
|
|
5389
5420
|
ref.value = [refValue];
|
|
@@ -5756,7 +5787,7 @@ function startMeasure(instance, type) {
|
|
|
5756
5787
|
perf.mark(`vue-${type}-${instance.uid}`);
|
|
5757
5788
|
}
|
|
5758
5789
|
{
|
|
5759
|
-
devtoolsPerfStart(instance, type,
|
|
5790
|
+
devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
|
|
5760
5791
|
}
|
|
5761
5792
|
}
|
|
5762
5793
|
function endMeasure(instance, type) {
|
|
@@ -5769,7 +5800,7 @@ function endMeasure(instance, type) {
|
|
|
5769
5800
|
perf.clearMarks(endTag);
|
|
5770
5801
|
}
|
|
5771
5802
|
{
|
|
5772
|
-
devtoolsPerfEnd(instance, type,
|
|
5803
|
+
devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
|
|
5773
5804
|
}
|
|
5774
5805
|
}
|
|
5775
5806
|
function isSupported() {
|
|
@@ -8158,9 +8189,10 @@ const PublicInstanceProxyHandlers = {
|
|
|
8158
8189
|
},
|
|
8159
8190
|
defineProperty(target, key, descriptor) {
|
|
8160
8191
|
if (descriptor.get != null) {
|
|
8161
|
-
|
|
8192
|
+
// invalidate key cache of a getter based property #5417
|
|
8193
|
+
target.$.accessCache[key] = 0;
|
|
8162
8194
|
}
|
|
8163
|
-
else if (descriptor
|
|
8195
|
+
else if (hasOwn(descriptor, 'value')) {
|
|
8164
8196
|
this.set(target, key, descriptor.value, null);
|
|
8165
8197
|
}
|
|
8166
8198
|
return Reflect.defineProperty(target, key, descriptor);
|
|
@@ -9039,7 +9071,7 @@ function isMemoSame(cached, memo) {
|
|
|
9039
9071
|
}
|
|
9040
9072
|
|
|
9041
9073
|
// Core API ------------------------------------------------------------------
|
|
9042
|
-
const version = "3.2.
|
|
9074
|
+
const version = "3.2.32";
|
|
9043
9075
|
/**
|
|
9044
9076
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
9045
9077
|
* @internal
|