vue 3.4.3 → 3.4.5
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/vue.esm-browser.js +19 -12
- package/dist/vue.esm-browser.prod.js +3 -3
- package/dist/vue.global.js +19 -12
- package/dist/vue.global.prod.js +4 -4
- package/dist/vue.runtime.esm-browser.js +19 -12
- package/dist/vue.runtime.esm-browser.prod.js +2 -2
- package/dist/vue.runtime.global.js +19 -12
- package/dist/vue.runtime.global.prod.js +3 -3
- package/package.json +11 -7
package/dist/vue.esm-browser.js
CHANGED
|
@@ -3001,7 +3001,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3001
3001
|
hiddenContainer,
|
|
3002
3002
|
anchor,
|
|
3003
3003
|
deps: 0,
|
|
3004
|
-
pendingId:
|
|
3004
|
+
pendingId: suspenseId++,
|
|
3005
3005
|
timeout: typeof timeout === "number" ? timeout : -1,
|
|
3006
3006
|
activeBranch: null,
|
|
3007
3007
|
pendingBranch: null,
|
|
@@ -3340,7 +3340,6 @@ function doWatch(source, cb, {
|
|
|
3340
3340
|
onTrack,
|
|
3341
3341
|
onTrigger
|
|
3342
3342
|
} = EMPTY_OBJ) {
|
|
3343
|
-
var _a;
|
|
3344
3343
|
if (cb && once) {
|
|
3345
3344
|
const _cb = cb;
|
|
3346
3345
|
cb = (...args) => {
|
|
@@ -3348,6 +3347,11 @@ function doWatch(source, cb, {
|
|
|
3348
3347
|
unwatch();
|
|
3349
3348
|
};
|
|
3350
3349
|
}
|
|
3350
|
+
if (deep !== void 0 && typeof deep === "number") {
|
|
3351
|
+
warn$1(
|
|
3352
|
+
`watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.`
|
|
3353
|
+
);
|
|
3354
|
+
}
|
|
3351
3355
|
if (!cb) {
|
|
3352
3356
|
if (immediate !== void 0) {
|
|
3353
3357
|
warn$1(
|
|
@@ -3372,7 +3376,11 @@ function doWatch(source, cb, {
|
|
|
3372
3376
|
`A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.`
|
|
3373
3377
|
);
|
|
3374
3378
|
};
|
|
3375
|
-
const instance =
|
|
3379
|
+
const instance = currentInstance;
|
|
3380
|
+
const reactiveGetter = (source2) => deep === true ? source2 : (
|
|
3381
|
+
// for deep: false, only traverse root-level properties
|
|
3382
|
+
traverse(source2, deep === false ? 1 : void 0)
|
|
3383
|
+
);
|
|
3376
3384
|
let getter;
|
|
3377
3385
|
let forceTrigger = false;
|
|
3378
3386
|
let isMultiSource = false;
|
|
@@ -3380,7 +3388,7 @@ function doWatch(source, cb, {
|
|
|
3380
3388
|
getter = () => source.value;
|
|
3381
3389
|
forceTrigger = isShallow(source);
|
|
3382
3390
|
} else if (isReactive(source)) {
|
|
3383
|
-
getter =
|
|
3391
|
+
getter = () => reactiveGetter(source);
|
|
3384
3392
|
forceTrigger = true;
|
|
3385
3393
|
} else if (isArray(source)) {
|
|
3386
3394
|
isMultiSource = true;
|
|
@@ -3389,7 +3397,7 @@ function doWatch(source, cb, {
|
|
|
3389
3397
|
if (isRef(s)) {
|
|
3390
3398
|
return s.value;
|
|
3391
3399
|
} else if (isReactive(s)) {
|
|
3392
|
-
return
|
|
3400
|
+
return reactiveGetter(s);
|
|
3393
3401
|
} else if (isFunction(s)) {
|
|
3394
3402
|
return callWithErrorHandling(s, instance, 2);
|
|
3395
3403
|
} else {
|
|
@@ -3401,9 +3409,6 @@ function doWatch(source, cb, {
|
|
|
3401
3409
|
getter = () => callWithErrorHandling(source, instance, 2);
|
|
3402
3410
|
} else {
|
|
3403
3411
|
getter = () => {
|
|
3404
|
-
if (instance && instance.isUnmounted) {
|
|
3405
|
-
return;
|
|
3406
|
-
}
|
|
3407
3412
|
if (cleanup) {
|
|
3408
3413
|
cleanup();
|
|
3409
3414
|
}
|
|
@@ -3466,10 +3471,11 @@ function doWatch(source, cb, {
|
|
|
3466
3471
|
scheduler = () => queueJob(job);
|
|
3467
3472
|
}
|
|
3468
3473
|
const effect = new ReactiveEffect(getter, NOOP, scheduler);
|
|
3474
|
+
const scope = getCurrentScope();
|
|
3469
3475
|
const unwatch = () => {
|
|
3470
3476
|
effect.stop();
|
|
3471
|
-
if (
|
|
3472
|
-
remove(
|
|
3477
|
+
if (scope) {
|
|
3478
|
+
remove(scope.effects, effect);
|
|
3473
3479
|
}
|
|
3474
3480
|
};
|
|
3475
3481
|
{
|
|
@@ -4812,6 +4818,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
4812
4818
|
return ref();
|
|
4813
4819
|
}
|
|
4814
4820
|
const camelizedName = camelize(name);
|
|
4821
|
+
const hyphenatedName = hyphenate(name);
|
|
4815
4822
|
const res = customRef((track, trigger) => {
|
|
4816
4823
|
let localValue;
|
|
4817
4824
|
watchSyncEffect(() => {
|
|
@@ -4829,7 +4836,7 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
4829
4836
|
set(value) {
|
|
4830
4837
|
const rawProps = i.vnode.props;
|
|
4831
4838
|
if (!(rawProps && // check if parent has passed v-model
|
|
4832
|
-
(name in rawProps || camelizedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
4839
|
+
(name in rawProps || camelizedName in rawProps || hyphenatedName in rawProps) && (`onUpdate:${name}` in rawProps || `onUpdate:${camelizedName}` in rawProps || `onUpdate:${hyphenatedName}` in rawProps)) && hasChanged(value, localValue)) {
|
|
4833
4840
|
localValue = value;
|
|
4834
4841
|
trigger();
|
|
4835
4842
|
}
|
|
@@ -9483,7 +9490,7 @@ function isMemoSame(cached, memo) {
|
|
|
9483
9490
|
return true;
|
|
9484
9491
|
}
|
|
9485
9492
|
|
|
9486
|
-
const version = "3.4.
|
|
9493
|
+
const version = "3.4.5";
|
|
9487
9494
|
const warn = warn$1 ;
|
|
9488
9495
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
9489
9496
|
const devtools = devtools$1 ;
|