@vue/compat 3.3.6 → 3.4.0-alpha.1
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.cjs.js +377 -254
- package/dist/vue.cjs.prod.js +331 -227
- package/dist/vue.esm-browser.js +378 -255
- package/dist/vue.esm-browser.prod.js +4 -4
- package/dist/vue.esm-bundler.js +379 -264
- package/dist/vue.global.js +377 -254
- package/dist/vue.global.prod.js +5 -5
- package/dist/vue.runtime.esm-browser.js +360 -248
- package/dist/vue.runtime.esm-browser.prod.js +5 -5
- package/dist/vue.runtime.esm-bundler.js +361 -257
- package/dist/vue.runtime.global.js +359 -247
- package/dist/vue.runtime.global.prod.js +5 -5
- package/package.json +2 -2
package/dist/vue.esm-bundler.js
CHANGED
|
@@ -419,117 +419,120 @@ function onScopeDispose(fn) {
|
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
|
|
422
|
-
const createDep = (effects) => {
|
|
423
|
-
const dep = new Set(effects);
|
|
424
|
-
dep.w = 0;
|
|
425
|
-
dep.n = 0;
|
|
426
|
-
return dep;
|
|
427
|
-
};
|
|
428
|
-
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
|
|
429
|
-
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
|
|
430
|
-
const initDepMarkers = ({ deps }) => {
|
|
431
|
-
if (deps.length) {
|
|
432
|
-
for (let i = 0; i < deps.length; i++) {
|
|
433
|
-
deps[i].w |= trackOpBit;
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
const finalizeDepMarkers = (effect) => {
|
|
438
|
-
const { deps } = effect;
|
|
439
|
-
if (deps.length) {
|
|
440
|
-
let ptr = 0;
|
|
441
|
-
for (let i = 0; i < deps.length; i++) {
|
|
442
|
-
const dep = deps[i];
|
|
443
|
-
if (wasTracked(dep) && !newTracked(dep)) {
|
|
444
|
-
dep.delete(effect);
|
|
445
|
-
} else {
|
|
446
|
-
deps[ptr++] = dep;
|
|
447
|
-
}
|
|
448
|
-
dep.w &= ~trackOpBit;
|
|
449
|
-
dep.n &= ~trackOpBit;
|
|
450
|
-
}
|
|
451
|
-
deps.length = ptr;
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
|
|
455
|
-
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
456
|
-
let effectTrackDepth = 0;
|
|
457
|
-
let trackOpBit = 1;
|
|
458
|
-
const maxMarkerBits = 30;
|
|
459
422
|
let activeEffect;
|
|
460
|
-
const ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "iterate" : "");
|
|
461
|
-
const MAP_KEY_ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Map key iterate" : "");
|
|
462
423
|
class ReactiveEffect {
|
|
463
|
-
constructor(fn, scheduler
|
|
424
|
+
constructor(fn, trigger, scheduler, scope) {
|
|
464
425
|
this.fn = fn;
|
|
426
|
+
this.trigger = trigger;
|
|
465
427
|
this.scheduler = scheduler;
|
|
466
428
|
this.active = true;
|
|
467
429
|
this.deps = [];
|
|
468
|
-
|
|
430
|
+
/**
|
|
431
|
+
* @internal
|
|
432
|
+
*/
|
|
433
|
+
this._dirtyLevel = 3;
|
|
434
|
+
/**
|
|
435
|
+
* @internal
|
|
436
|
+
*/
|
|
437
|
+
this._trackId = 0;
|
|
438
|
+
/**
|
|
439
|
+
* @internal
|
|
440
|
+
*/
|
|
441
|
+
this._runnings = 0;
|
|
442
|
+
/**
|
|
443
|
+
* @internal
|
|
444
|
+
*/
|
|
445
|
+
this._queryings = 0;
|
|
446
|
+
/**
|
|
447
|
+
* @internal
|
|
448
|
+
*/
|
|
449
|
+
this._depsLength = 0;
|
|
469
450
|
recordEffectScope(this, scope);
|
|
470
451
|
}
|
|
452
|
+
get dirty() {
|
|
453
|
+
if (this._dirtyLevel === 1) {
|
|
454
|
+
this._dirtyLevel = 0;
|
|
455
|
+
this._queryings++;
|
|
456
|
+
pauseTracking();
|
|
457
|
+
for (const dep of this.deps) {
|
|
458
|
+
if (dep.computed) {
|
|
459
|
+
triggerComputed(dep.computed);
|
|
460
|
+
if (this._dirtyLevel >= 2) {
|
|
461
|
+
break;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
resetTracking();
|
|
466
|
+
this._queryings--;
|
|
467
|
+
}
|
|
468
|
+
return this._dirtyLevel >= 2;
|
|
469
|
+
}
|
|
470
|
+
set dirty(v) {
|
|
471
|
+
this._dirtyLevel = v ? 3 : 0;
|
|
472
|
+
}
|
|
471
473
|
run() {
|
|
474
|
+
this._dirtyLevel = 0;
|
|
472
475
|
if (!this.active) {
|
|
473
476
|
return this.fn();
|
|
474
477
|
}
|
|
475
|
-
let parent = activeEffect;
|
|
476
478
|
let lastShouldTrack = shouldTrack;
|
|
477
|
-
|
|
478
|
-
if (parent === this) {
|
|
479
|
-
return;
|
|
480
|
-
}
|
|
481
|
-
parent = parent.parent;
|
|
482
|
-
}
|
|
479
|
+
let lastEffect = activeEffect;
|
|
483
480
|
try {
|
|
484
|
-
this.parent = activeEffect;
|
|
485
|
-
activeEffect = this;
|
|
486
481
|
shouldTrack = true;
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
} else {
|
|
491
|
-
cleanupEffect(this);
|
|
492
|
-
}
|
|
482
|
+
activeEffect = this;
|
|
483
|
+
this._runnings++;
|
|
484
|
+
preCleanupEffect(this);
|
|
493
485
|
return this.fn();
|
|
494
486
|
} finally {
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
trackOpBit = 1 << --effectTrackDepth;
|
|
499
|
-
activeEffect = this.parent;
|
|
487
|
+
postCleanupEffect(this);
|
|
488
|
+
this._runnings--;
|
|
489
|
+
activeEffect = lastEffect;
|
|
500
490
|
shouldTrack = lastShouldTrack;
|
|
501
|
-
this.parent = void 0;
|
|
502
|
-
if (this.deferStop) {
|
|
503
|
-
this.stop();
|
|
504
|
-
}
|
|
505
491
|
}
|
|
506
492
|
}
|
|
507
493
|
stop() {
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
this.onStop();
|
|
514
|
-
}
|
|
494
|
+
var _a;
|
|
495
|
+
if (this.active) {
|
|
496
|
+
preCleanupEffect(this);
|
|
497
|
+
postCleanupEffect(this);
|
|
498
|
+
(_a = this.onStop) == null ? void 0 : _a.call(this);
|
|
515
499
|
this.active = false;
|
|
516
500
|
}
|
|
517
501
|
}
|
|
518
502
|
}
|
|
519
|
-
function
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
503
|
+
function triggerComputed(computed) {
|
|
504
|
+
return computed.value;
|
|
505
|
+
}
|
|
506
|
+
function preCleanupEffect(effect2) {
|
|
507
|
+
effect2._trackId++;
|
|
508
|
+
effect2._depsLength = 0;
|
|
509
|
+
}
|
|
510
|
+
function postCleanupEffect(effect2) {
|
|
511
|
+
if (effect2.deps && effect2.deps.length > effect2._depsLength) {
|
|
512
|
+
for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
|
|
513
|
+
cleanupDepEffect(effect2.deps[i], effect2);
|
|
514
|
+
}
|
|
515
|
+
effect2.deps.length = effect2._depsLength;
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
function cleanupDepEffect(dep, effect2) {
|
|
519
|
+
const trackId = dep.get(effect2);
|
|
520
|
+
if (trackId !== void 0 && effect2._trackId !== trackId) {
|
|
521
|
+
dep.delete(effect2);
|
|
522
|
+
if (dep.size === 0) {
|
|
523
|
+
dep.cleanup();
|
|
524
524
|
}
|
|
525
|
-
deps.length = 0;
|
|
526
525
|
}
|
|
527
526
|
}
|
|
528
527
|
function effect(fn, options) {
|
|
529
528
|
if (fn.effect instanceof ReactiveEffect) {
|
|
530
529
|
fn = fn.effect.fn;
|
|
531
530
|
}
|
|
532
|
-
const _effect = new ReactiveEffect(fn)
|
|
531
|
+
const _effect = new ReactiveEffect(fn, NOOP, () => {
|
|
532
|
+
if (_effect.dirty) {
|
|
533
|
+
_effect.run();
|
|
534
|
+
}
|
|
535
|
+
});
|
|
533
536
|
if (options) {
|
|
534
537
|
extend(_effect, options);
|
|
535
538
|
if (options.scope)
|
|
@@ -546,6 +549,7 @@ function stop(runner) {
|
|
|
546
549
|
runner.effect.stop();
|
|
547
550
|
}
|
|
548
551
|
let shouldTrack = true;
|
|
552
|
+
let pauseScheduleStack = 0;
|
|
549
553
|
const trackStack = [];
|
|
550
554
|
function pauseTracking() {
|
|
551
555
|
trackStack.push(shouldTrack);
|
|
@@ -555,6 +559,68 @@ function resetTracking() {
|
|
|
555
559
|
const last = trackStack.pop();
|
|
556
560
|
shouldTrack = last === void 0 ? true : last;
|
|
557
561
|
}
|
|
562
|
+
function pauseScheduling() {
|
|
563
|
+
pauseScheduleStack++;
|
|
564
|
+
}
|
|
565
|
+
function resetScheduling() {
|
|
566
|
+
pauseScheduleStack--;
|
|
567
|
+
while (!pauseScheduleStack && queueEffectSchedulers.length) {
|
|
568
|
+
queueEffectSchedulers.shift()();
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
function trackEffect(effect2, dep, debuggerEventExtraInfo) {
|
|
572
|
+
var _a;
|
|
573
|
+
if (dep.get(effect2) !== effect2._trackId) {
|
|
574
|
+
dep.set(effect2, effect2._trackId);
|
|
575
|
+
const oldDep = effect2.deps[effect2._depsLength];
|
|
576
|
+
if (oldDep !== dep) {
|
|
577
|
+
if (oldDep) {
|
|
578
|
+
cleanupDepEffect(oldDep, effect2);
|
|
579
|
+
}
|
|
580
|
+
effect2.deps[effect2._depsLength++] = dep;
|
|
581
|
+
} else {
|
|
582
|
+
effect2._depsLength++;
|
|
583
|
+
}
|
|
584
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
585
|
+
(_a = effect2.onTrack) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
const queueEffectSchedulers = [];
|
|
590
|
+
function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
|
|
591
|
+
var _a;
|
|
592
|
+
pauseScheduling();
|
|
593
|
+
for (const effect2 of dep.keys()) {
|
|
594
|
+
if (!effect2.allowRecurse && effect2._runnings) {
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
if (effect2._dirtyLevel < dirtyLevel && (!effect2._runnings || dirtyLevel !== 2)) {
|
|
598
|
+
const lastDirtyLevel = effect2._dirtyLevel;
|
|
599
|
+
effect2._dirtyLevel = dirtyLevel;
|
|
600
|
+
if (lastDirtyLevel === 0 && (!effect2._queryings || dirtyLevel !== 2)) {
|
|
601
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
602
|
+
(_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
603
|
+
}
|
|
604
|
+
effect2.trigger();
|
|
605
|
+
if (effect2.scheduler) {
|
|
606
|
+
queueEffectSchedulers.push(effect2.scheduler);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
resetScheduling();
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
const createDep = (cleanup, computed) => {
|
|
615
|
+
const dep = /* @__PURE__ */ new Map();
|
|
616
|
+
dep.cleanup = cleanup;
|
|
617
|
+
dep.computed = computed;
|
|
618
|
+
return dep;
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
const targetMap = /* @__PURE__ */ new WeakMap();
|
|
622
|
+
const ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "iterate" : "");
|
|
623
|
+
const MAP_KEY_ITERATE_KEY = Symbol(!!(process.env.NODE_ENV !== "production") ? "Map key iterate" : "");
|
|
558
624
|
function track(target, type, key) {
|
|
559
625
|
if (shouldTrack && activeEffect) {
|
|
560
626
|
let depsMap = targetMap.get(target);
|
|
@@ -563,35 +629,17 @@ function track(target, type, key) {
|
|
|
563
629
|
}
|
|
564
630
|
let dep = depsMap.get(key);
|
|
565
631
|
if (!dep) {
|
|
566
|
-
depsMap.set(key, dep = createDep());
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
shouldTrack2 = !wasTracked(dep);
|
|
578
|
-
}
|
|
579
|
-
} else {
|
|
580
|
-
shouldTrack2 = !dep.has(activeEffect);
|
|
581
|
-
}
|
|
582
|
-
if (shouldTrack2) {
|
|
583
|
-
dep.add(activeEffect);
|
|
584
|
-
activeEffect.deps.push(dep);
|
|
585
|
-
if (!!(process.env.NODE_ENV !== "production") && activeEffect.onTrack) {
|
|
586
|
-
activeEffect.onTrack(
|
|
587
|
-
extend(
|
|
588
|
-
{
|
|
589
|
-
effect: activeEffect
|
|
590
|
-
},
|
|
591
|
-
debuggerEventExtraInfo
|
|
592
|
-
)
|
|
593
|
-
);
|
|
594
|
-
}
|
|
632
|
+
depsMap.set(key, dep = createDep(() => depsMap.delete(key)));
|
|
633
|
+
}
|
|
634
|
+
trackEffect(
|
|
635
|
+
activeEffect,
|
|
636
|
+
dep,
|
|
637
|
+
!!(process.env.NODE_ENV !== "production") ? {
|
|
638
|
+
target,
|
|
639
|
+
type,
|
|
640
|
+
key
|
|
641
|
+
} : void 0
|
|
642
|
+
);
|
|
595
643
|
}
|
|
596
644
|
}
|
|
597
645
|
function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
@@ -605,7 +653,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
605
653
|
} else if (key === "length" && isArray(target)) {
|
|
606
654
|
const newLength = Number(newValue);
|
|
607
655
|
depsMap.forEach((dep, key2) => {
|
|
608
|
-
if (key2 === "length" || key2 >= newLength) {
|
|
656
|
+
if (key2 === "length" || !isSymbol(key2) && key2 >= newLength) {
|
|
609
657
|
deps.push(dep);
|
|
610
658
|
}
|
|
611
659
|
});
|
|
@@ -639,53 +687,24 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
639
687
|
break;
|
|
640
688
|
}
|
|
641
689
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
if (
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
}
|
|
658
|
-
if (!!(process.env.NODE_ENV !== "production")) {
|
|
659
|
-
triggerEffects(createDep(effects), eventInfo);
|
|
660
|
-
} else {
|
|
661
|
-
triggerEffects(createDep(effects));
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
}
|
|
665
|
-
function triggerEffects(dep, debuggerEventExtraInfo) {
|
|
666
|
-
const effects = isArray(dep) ? dep : [...dep];
|
|
667
|
-
for (const effect2 of effects) {
|
|
668
|
-
if (effect2.computed) {
|
|
669
|
-
triggerEffect(effect2, debuggerEventExtraInfo);
|
|
670
|
-
}
|
|
671
|
-
}
|
|
672
|
-
for (const effect2 of effects) {
|
|
673
|
-
if (!effect2.computed) {
|
|
674
|
-
triggerEffect(effect2, debuggerEventExtraInfo);
|
|
675
|
-
}
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
function triggerEffect(effect2, debuggerEventExtraInfo) {
|
|
679
|
-
if (effect2 !== activeEffect || effect2.allowRecurse) {
|
|
680
|
-
if (!!(process.env.NODE_ENV !== "production") && effect2.onTrigger) {
|
|
681
|
-
effect2.onTrigger(extend({ effect: effect2 }, debuggerEventExtraInfo));
|
|
682
|
-
}
|
|
683
|
-
if (effect2.scheduler) {
|
|
684
|
-
effect2.scheduler();
|
|
685
|
-
} else {
|
|
686
|
-
effect2.run();
|
|
690
|
+
pauseScheduling();
|
|
691
|
+
for (const dep of deps) {
|
|
692
|
+
if (dep) {
|
|
693
|
+
triggerEffects(
|
|
694
|
+
dep,
|
|
695
|
+
3,
|
|
696
|
+
!!(process.env.NODE_ENV !== "production") ? {
|
|
697
|
+
target,
|
|
698
|
+
type,
|
|
699
|
+
key,
|
|
700
|
+
newValue,
|
|
701
|
+
oldValue,
|
|
702
|
+
oldTarget
|
|
703
|
+
} : void 0
|
|
704
|
+
);
|
|
687
705
|
}
|
|
688
706
|
}
|
|
707
|
+
resetScheduling();
|
|
689
708
|
}
|
|
690
709
|
function getDepFromReactive(object, key) {
|
|
691
710
|
var _a;
|
|
@@ -716,7 +735,9 @@ function createArrayInstrumentations() {
|
|
|
716
735
|
["push", "pop", "shift", "unshift", "splice"].forEach((key) => {
|
|
717
736
|
instrumentations[key] = function(...args) {
|
|
718
737
|
pauseTracking();
|
|
738
|
+
pauseScheduling();
|
|
719
739
|
const res = toRaw(this)[key].apply(this, args);
|
|
740
|
+
resetScheduling();
|
|
720
741
|
resetTracking();
|
|
721
742
|
return res;
|
|
722
743
|
};
|
|
@@ -1255,34 +1276,93 @@ function markRaw(value) {
|
|
|
1255
1276
|
const toReactive = (value) => isObject(value) ? reactive(value) : value;
|
|
1256
1277
|
const toReadonly = (value) => isObject(value) ? readonly(value) : value;
|
|
1257
1278
|
|
|
1279
|
+
class ComputedRefImpl {
|
|
1280
|
+
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1281
|
+
this._setter = _setter;
|
|
1282
|
+
this.dep = void 0;
|
|
1283
|
+
this.__v_isRef = true;
|
|
1284
|
+
this["__v_isReadonly"] = false;
|
|
1285
|
+
this.effect = new ReactiveEffect(getter, () => {
|
|
1286
|
+
triggerRefValue(this, 1);
|
|
1287
|
+
});
|
|
1288
|
+
this.effect.computed = this;
|
|
1289
|
+
this.effect.active = this._cacheable = !isSSR;
|
|
1290
|
+
this["__v_isReadonly"] = isReadonly;
|
|
1291
|
+
}
|
|
1292
|
+
get value() {
|
|
1293
|
+
const self = toRaw(this);
|
|
1294
|
+
trackRefValue(self);
|
|
1295
|
+
if (!self._cacheable || self.effect.dirty) {
|
|
1296
|
+
if (hasChanged(self._value, self._value = self.effect.run())) {
|
|
1297
|
+
triggerRefValue(self, 2);
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
return self._value;
|
|
1301
|
+
}
|
|
1302
|
+
set value(newValue) {
|
|
1303
|
+
this._setter(newValue);
|
|
1304
|
+
}
|
|
1305
|
+
// #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
|
|
1306
|
+
get _dirty() {
|
|
1307
|
+
return this.effect.dirty;
|
|
1308
|
+
}
|
|
1309
|
+
set _dirty(v) {
|
|
1310
|
+
this.effect.dirty = v;
|
|
1311
|
+
}
|
|
1312
|
+
// #endregion
|
|
1313
|
+
}
|
|
1314
|
+
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1315
|
+
let getter;
|
|
1316
|
+
let setter;
|
|
1317
|
+
const onlyGetter = isFunction(getterOrOptions);
|
|
1318
|
+
if (onlyGetter) {
|
|
1319
|
+
getter = getterOrOptions;
|
|
1320
|
+
setter = !!(process.env.NODE_ENV !== "production") ? () => {
|
|
1321
|
+
console.warn("Write operation failed: computed value is readonly");
|
|
1322
|
+
} : NOOP;
|
|
1323
|
+
} else {
|
|
1324
|
+
getter = getterOrOptions.get;
|
|
1325
|
+
setter = getterOrOptions.set;
|
|
1326
|
+
}
|
|
1327
|
+
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
1328
|
+
if (!!(process.env.NODE_ENV !== "production") && debugOptions && !isSSR) {
|
|
1329
|
+
cRef.effect.onTrack = debugOptions.onTrack;
|
|
1330
|
+
cRef.effect.onTrigger = debugOptions.onTrigger;
|
|
1331
|
+
}
|
|
1332
|
+
return cRef;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1258
1335
|
function trackRefValue(ref2) {
|
|
1259
1336
|
if (shouldTrack && activeEffect) {
|
|
1260
1337
|
ref2 = toRaw(ref2);
|
|
1261
|
-
|
|
1262
|
-
|
|
1338
|
+
trackEffect(
|
|
1339
|
+
activeEffect,
|
|
1340
|
+
ref2.dep || (ref2.dep = createDep(
|
|
1341
|
+
() => ref2.dep = void 0,
|
|
1342
|
+
ref2 instanceof ComputedRefImpl ? ref2 : void 0
|
|
1343
|
+
)),
|
|
1344
|
+
!!(process.env.NODE_ENV !== "production") ? {
|
|
1263
1345
|
target: ref2,
|
|
1264
1346
|
type: "get",
|
|
1265
1347
|
key: "value"
|
|
1266
|
-
}
|
|
1267
|
-
|
|
1268
|
-
trackEffects(ref2.dep || (ref2.dep = createDep()));
|
|
1269
|
-
}
|
|
1348
|
+
} : void 0
|
|
1349
|
+
);
|
|
1270
1350
|
}
|
|
1271
1351
|
}
|
|
1272
|
-
function triggerRefValue(ref2, newVal) {
|
|
1352
|
+
function triggerRefValue(ref2, dirtyLevel = 3, newVal) {
|
|
1273
1353
|
ref2 = toRaw(ref2);
|
|
1274
1354
|
const dep = ref2.dep;
|
|
1275
1355
|
if (dep) {
|
|
1276
|
-
|
|
1277
|
-
|
|
1356
|
+
triggerEffects(
|
|
1357
|
+
dep,
|
|
1358
|
+
dirtyLevel,
|
|
1359
|
+
!!(process.env.NODE_ENV !== "production") ? {
|
|
1278
1360
|
target: ref2,
|
|
1279
1361
|
type: "set",
|
|
1280
1362
|
key: "value",
|
|
1281
1363
|
newValue: newVal
|
|
1282
|
-
}
|
|
1283
|
-
|
|
1284
|
-
triggerEffects(dep);
|
|
1285
|
-
}
|
|
1364
|
+
} : void 0
|
|
1365
|
+
);
|
|
1286
1366
|
}
|
|
1287
1367
|
}
|
|
1288
1368
|
function isRef(r) {
|
|
@@ -1318,12 +1398,12 @@ class RefImpl {
|
|
|
1318
1398
|
if (hasChanged(newVal, this._rawValue)) {
|
|
1319
1399
|
this._rawValue = newVal;
|
|
1320
1400
|
this._value = useDirectValue ? newVal : toReactive(newVal);
|
|
1321
|
-
triggerRefValue(this, newVal);
|
|
1401
|
+
triggerRefValue(this, 3, newVal);
|
|
1322
1402
|
}
|
|
1323
1403
|
}
|
|
1324
1404
|
}
|
|
1325
1405
|
function triggerRef(ref2) {
|
|
1326
|
-
triggerRefValue(ref2, !!(process.env.NODE_ENV !== "production") ? ref2.value : void 0);
|
|
1406
|
+
triggerRefValue(ref2, 3, !!(process.env.NODE_ENV !== "production") ? ref2.value : void 0);
|
|
1327
1407
|
}
|
|
1328
1408
|
function unref(ref2) {
|
|
1329
1409
|
return isRef(ref2) ? ref2.value : ref2;
|
|
@@ -1421,57 +1501,6 @@ function propertyToRef(source, key, defaultValue) {
|
|
|
1421
1501
|
return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue);
|
|
1422
1502
|
}
|
|
1423
1503
|
|
|
1424
|
-
class ComputedRefImpl {
|
|
1425
|
-
constructor(getter, _setter, isReadonly, isSSR) {
|
|
1426
|
-
this._setter = _setter;
|
|
1427
|
-
this.dep = void 0;
|
|
1428
|
-
this.__v_isRef = true;
|
|
1429
|
-
this["__v_isReadonly"] = false;
|
|
1430
|
-
this._dirty = true;
|
|
1431
|
-
this.effect = new ReactiveEffect(getter, () => {
|
|
1432
|
-
if (!this._dirty) {
|
|
1433
|
-
this._dirty = true;
|
|
1434
|
-
triggerRefValue(this);
|
|
1435
|
-
}
|
|
1436
|
-
});
|
|
1437
|
-
this.effect.computed = this;
|
|
1438
|
-
this.effect.active = this._cacheable = !isSSR;
|
|
1439
|
-
this["__v_isReadonly"] = isReadonly;
|
|
1440
|
-
}
|
|
1441
|
-
get value() {
|
|
1442
|
-
const self = toRaw(this);
|
|
1443
|
-
trackRefValue(self);
|
|
1444
|
-
if (self._dirty || !self._cacheable) {
|
|
1445
|
-
self._dirty = false;
|
|
1446
|
-
self._value = self.effect.run();
|
|
1447
|
-
}
|
|
1448
|
-
return self._value;
|
|
1449
|
-
}
|
|
1450
|
-
set value(newValue) {
|
|
1451
|
-
this._setter(newValue);
|
|
1452
|
-
}
|
|
1453
|
-
}
|
|
1454
|
-
function computed$1(getterOrOptions, debugOptions, isSSR = false) {
|
|
1455
|
-
let getter;
|
|
1456
|
-
let setter;
|
|
1457
|
-
const onlyGetter = isFunction(getterOrOptions);
|
|
1458
|
-
if (onlyGetter) {
|
|
1459
|
-
getter = getterOrOptions;
|
|
1460
|
-
setter = !!(process.env.NODE_ENV !== "production") ? () => {
|
|
1461
|
-
console.warn("Write operation failed: computed value is readonly");
|
|
1462
|
-
} : NOOP;
|
|
1463
|
-
} else {
|
|
1464
|
-
getter = getterOrOptions.get;
|
|
1465
|
-
setter = getterOrOptions.set;
|
|
1466
|
-
}
|
|
1467
|
-
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
1468
|
-
if (!!(process.env.NODE_ENV !== "production") && debugOptions && !isSSR) {
|
|
1469
|
-
cRef.effect.onTrack = debugOptions.onTrack;
|
|
1470
|
-
cRef.effect.onTrigger = debugOptions.onTrigger;
|
|
1471
|
-
}
|
|
1472
|
-
return cRef;
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
1504
|
const stack = [];
|
|
1476
1505
|
function pushWarningContext(vnode) {
|
|
1477
1506
|
stack.push(vnode);
|
|
@@ -1590,7 +1619,7 @@ function assertNumber(val, type) {
|
|
|
1590
1619
|
}
|
|
1591
1620
|
}
|
|
1592
1621
|
|
|
1593
|
-
const ErrorTypeStrings = {
|
|
1622
|
+
const ErrorTypeStrings$1 = {
|
|
1594
1623
|
["sp"]: "serverPrefetch hook",
|
|
1595
1624
|
["bc"]: "beforeCreate hook",
|
|
1596
1625
|
["c"]: "created hook",
|
|
@@ -1651,7 +1680,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1651
1680
|
if (instance) {
|
|
1652
1681
|
let cur = instance.parent;
|
|
1653
1682
|
const exposedInstance = instance.proxy;
|
|
1654
|
-
const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings[type] : type;
|
|
1683
|
+
const errorInfo = !!(process.env.NODE_ENV !== "production") ? ErrorTypeStrings$1[type] : type;
|
|
1655
1684
|
while (cur) {
|
|
1656
1685
|
const errorCapturedHooks = cur.ec;
|
|
1657
1686
|
if (errorCapturedHooks) {
|
|
@@ -1678,7 +1707,7 @@ function handleError(err, instance, type, throwInDev = true) {
|
|
|
1678
1707
|
}
|
|
1679
1708
|
function logError(err, type, contextVNode, throwInDev = true) {
|
|
1680
1709
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1681
|
-
const info = ErrorTypeStrings[type];
|
|
1710
|
+
const info = ErrorTypeStrings$1[type];
|
|
1682
1711
|
if (contextVNode) {
|
|
1683
1712
|
pushWarningContext(contextVNode);
|
|
1684
1713
|
}
|
|
@@ -1715,8 +1744,13 @@ function findInsertionIndex(id) {
|
|
|
1715
1744
|
let end = queue.length;
|
|
1716
1745
|
while (start < end) {
|
|
1717
1746
|
const middle = start + end >>> 1;
|
|
1718
|
-
const
|
|
1719
|
-
middleJobId
|
|
1747
|
+
const middleJob = queue[middle];
|
|
1748
|
+
const middleJobId = getId(middleJob);
|
|
1749
|
+
if (middleJobId < id || middleJobId === id && middleJob.pre) {
|
|
1750
|
+
start = middle + 1;
|
|
1751
|
+
} else {
|
|
1752
|
+
end = middle;
|
|
1753
|
+
}
|
|
1720
1754
|
}
|
|
1721
1755
|
return start;
|
|
1722
1756
|
}
|
|
@@ -1903,6 +1937,7 @@ function rerender(id, newRender) {
|
|
|
1903
1937
|
}
|
|
1904
1938
|
instance.renderCache = [];
|
|
1905
1939
|
isHmrUpdating = true;
|
|
1940
|
+
instance.effect.dirty = true;
|
|
1906
1941
|
instance.update();
|
|
1907
1942
|
isHmrUpdating = false;
|
|
1908
1943
|
});
|
|
@@ -1930,6 +1965,7 @@ function reload(id, newComp) {
|
|
|
1930
1965
|
instance.ceReload(newComp.styles);
|
|
1931
1966
|
hmrDirtyComponents.delete(oldComp);
|
|
1932
1967
|
} else if (instance.parent) {
|
|
1968
|
+
instance.parent.effect.dirty = true;
|
|
1933
1969
|
queueJob(instance.parent.update);
|
|
1934
1970
|
} else if (instance.appContext.reload) {
|
|
1935
1971
|
instance.appContext.reload();
|
|
@@ -3307,14 +3343,16 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3307
3343
|
parentComponent: parentComponent2,
|
|
3308
3344
|
container: container2
|
|
3309
3345
|
} = suspense;
|
|
3346
|
+
let delayEnter = false;
|
|
3310
3347
|
if (suspense.isHydrating) {
|
|
3311
3348
|
suspense.isHydrating = false;
|
|
3312
3349
|
} else if (!resume) {
|
|
3313
|
-
|
|
3350
|
+
delayEnter = activeBranch && pendingBranch.transition && pendingBranch.transition.mode === "out-in";
|
|
3314
3351
|
if (delayEnter) {
|
|
3315
3352
|
activeBranch.transition.afterLeave = () => {
|
|
3316
3353
|
if (pendingId === suspense.pendingId) {
|
|
3317
3354
|
move(pendingBranch, container2, anchor2, 0);
|
|
3355
|
+
queuePostFlushCb(effects);
|
|
3318
3356
|
}
|
|
3319
3357
|
};
|
|
3320
3358
|
}
|
|
@@ -3340,7 +3378,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
|
|
|
3340
3378
|
}
|
|
3341
3379
|
parent = parent.parent;
|
|
3342
3380
|
}
|
|
3343
|
-
if (!hasUnresolvedAncestor) {
|
|
3381
|
+
if (!hasUnresolvedAncestor && !delayEnter) {
|
|
3344
3382
|
queuePostFlushCb(effects);
|
|
3345
3383
|
}
|
|
3346
3384
|
suspense.effects = [];
|
|
@@ -3626,8 +3664,15 @@ function watch(source, cb, options) {
|
|
|
3626
3664
|
}
|
|
3627
3665
|
return doWatch(source, cb, options);
|
|
3628
3666
|
}
|
|
3629
|
-
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3667
|
+
function doWatch(source, cb, { immediate, deep, flush, once, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
3630
3668
|
var _a;
|
|
3669
|
+
if (cb && once) {
|
|
3670
|
+
const _cb = cb;
|
|
3671
|
+
cb = (...args) => {
|
|
3672
|
+
_cb(...args);
|
|
3673
|
+
unwatch();
|
|
3674
|
+
};
|
|
3675
|
+
}
|
|
3631
3676
|
if (!!(process.env.NODE_ENV !== "production") && !cb) {
|
|
3632
3677
|
if (immediate !== void 0) {
|
|
3633
3678
|
warn(
|
|
@@ -3639,6 +3684,11 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3639
3684
|
`watch() "deep" option is only respected when using the watch(source, callback, options?) signature.`
|
|
3640
3685
|
);
|
|
3641
3686
|
}
|
|
3687
|
+
if (once !== void 0) {
|
|
3688
|
+
warn(
|
|
3689
|
+
`watch() "once" option is only respected when using the watch(source, callback, options?) signature.`
|
|
3690
|
+
);
|
|
3691
|
+
}
|
|
3642
3692
|
}
|
|
3643
3693
|
const warnInvalidSource = (s) => {
|
|
3644
3694
|
warn(
|
|
@@ -3735,7 +3785,7 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3735
3785
|
}
|
|
3736
3786
|
let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE;
|
|
3737
3787
|
const job = () => {
|
|
3738
|
-
if (!effect.active) {
|
|
3788
|
+
if (!effect.active || !effect.dirty) {
|
|
3739
3789
|
return;
|
|
3740
3790
|
}
|
|
3741
3791
|
if (cb) {
|
|
@@ -3768,7 +3818,13 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3768
3818
|
job.id = instance.uid;
|
|
3769
3819
|
scheduler = () => queueJob(job);
|
|
3770
3820
|
}
|
|
3771
|
-
const effect = new ReactiveEffect(getter, scheduler);
|
|
3821
|
+
const effect = new ReactiveEffect(getter, NOOP, scheduler);
|
|
3822
|
+
const unwatch = () => {
|
|
3823
|
+
effect.stop();
|
|
3824
|
+
if (instance && instance.scope) {
|
|
3825
|
+
remove(instance.scope.effects, effect);
|
|
3826
|
+
}
|
|
3827
|
+
};
|
|
3772
3828
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
3773
3829
|
effect.onTrack = onTrack;
|
|
3774
3830
|
effect.onTrigger = onTrigger;
|
|
@@ -3787,12 +3843,6 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
|
|
|
3787
3843
|
} else {
|
|
3788
3844
|
effect.run();
|
|
3789
3845
|
}
|
|
3790
|
-
const unwatch = () => {
|
|
3791
|
-
effect.stop();
|
|
3792
|
-
if (instance && instance.scope) {
|
|
3793
|
-
remove(instance.scope.effects, effect);
|
|
3794
|
-
}
|
|
3795
|
-
};
|
|
3796
3846
|
if (ssrCleanup)
|
|
3797
3847
|
ssrCleanup.push(unwatch);
|
|
3798
3848
|
return unwatch;
|
|
@@ -4029,6 +4079,7 @@ const BaseTransitionImpl = {
|
|
|
4029
4079
|
leavingHooks.afterLeave = () => {
|
|
4030
4080
|
state.isLeaving = false;
|
|
4031
4081
|
if (instance.update.active !== false) {
|
|
4082
|
+
instance.effect.dirty = true;
|
|
4032
4083
|
instance.update();
|
|
4033
4084
|
}
|
|
4034
4085
|
};
|
|
@@ -4367,6 +4418,7 @@ function defineAsyncComponent(source) {
|
|
|
4367
4418
|
load().then(() => {
|
|
4368
4419
|
loaded.value = true;
|
|
4369
4420
|
if (instance.parent && isKeepAlive(instance.parent.vnode)) {
|
|
4421
|
+
instance.parent.effect.dirty = true;
|
|
4370
4422
|
queueJob(instance.parent.update);
|
|
4371
4423
|
}
|
|
4372
4424
|
}).catch((err) => {
|
|
@@ -4670,7 +4722,7 @@ function injectHook(type, hook, target = currentInstance, prepend = false) {
|
|
|
4670
4722
|
}
|
|
4671
4723
|
return wrappedHook;
|
|
4672
4724
|
} else if (!!(process.env.NODE_ENV !== "production")) {
|
|
4673
|
-
const apiName = toHandlerKey(ErrorTypeStrings[type].replace(/ hook$/, ""));
|
|
4725
|
+
const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, ""));
|
|
4674
4726
|
warn(
|
|
4675
4727
|
`${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().` + (` If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` )
|
|
4676
4728
|
);
|
|
@@ -5392,7 +5444,10 @@ const publicPropertiesMap = (
|
|
|
5392
5444
|
$root: (i) => getPublicInstance(i.root),
|
|
5393
5445
|
$emit: (i) => i.emit,
|
|
5394
5446
|
$options: (i) => __VUE_OPTIONS_API__ ? resolveMergedOptions(i) : i.type,
|
|
5395
|
-
$forceUpdate: (i) => i.f || (i.f = () =>
|
|
5447
|
+
$forceUpdate: (i) => i.f || (i.f = () => {
|
|
5448
|
+
i.effect.dirty = true;
|
|
5449
|
+
queueJob(i.update);
|
|
5450
|
+
}),
|
|
5396
5451
|
$nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)),
|
|
5397
5452
|
$watch: (i) => __VUE_OPTIONS_API__ ? instanceWatch.bind(i) : NOOP
|
|
5398
5453
|
})
|
|
@@ -6295,7 +6350,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
|
|
|
6295
6350
|
return vm;
|
|
6296
6351
|
}
|
|
6297
6352
|
}
|
|
6298
|
-
Vue.version = `2.6.14-compat:${"3.
|
|
6353
|
+
Vue.version = `2.6.14-compat:${"3.4.0-alpha.1"}`;
|
|
6299
6354
|
Vue.config = singletonApp.config;
|
|
6300
6355
|
Vue.use = (p, ...options) => {
|
|
6301
6356
|
if (p && isFunction(p.install)) {
|
|
@@ -7628,7 +7683,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7628
7683
|
break;
|
|
7629
7684
|
case Comment:
|
|
7630
7685
|
if (domType !== 8 /* COMMENT */ || isFragmentStart) {
|
|
7631
|
-
|
|
7686
|
+
if (node.tagName.toLowerCase() === "template") {
|
|
7687
|
+
const content = vnode.el.content.firstChild;
|
|
7688
|
+
replaceNode(content, node, parentComponent);
|
|
7689
|
+
vnode.el = node = content;
|
|
7690
|
+
nextNode = nextSibling(node);
|
|
7691
|
+
} else {
|
|
7692
|
+
nextNode = onMismatch();
|
|
7693
|
+
}
|
|
7632
7694
|
} else {
|
|
7633
7695
|
nextNode = nextSibling(node);
|
|
7634
7696
|
}
|
|
@@ -7670,7 +7732,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7670
7732
|
break;
|
|
7671
7733
|
default:
|
|
7672
7734
|
if (shapeFlag & 1) {
|
|
7673
|
-
if (domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) {
|
|
7735
|
+
if ((domType !== 1 /* ELEMENT */ || vnode.type.toLowerCase() !== node.tagName.toLowerCase()) && !isTemplateNode(node)) {
|
|
7674
7736
|
nextNode = onMismatch();
|
|
7675
7737
|
} else {
|
|
7676
7738
|
nextNode = hydrateElement(
|
|
@@ -7685,6 +7747,13 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7685
7747
|
} else if (shapeFlag & 6) {
|
|
7686
7748
|
vnode.slotScopeIds = slotScopeIds;
|
|
7687
7749
|
const container = parentNode(node);
|
|
7750
|
+
if (isFragmentStart) {
|
|
7751
|
+
nextNode = locateClosingAnchor(node);
|
|
7752
|
+
} else if (isComment(node) && node.data === "teleport start") {
|
|
7753
|
+
nextNode = locateClosingAnchor(node, node.data, "teleport end");
|
|
7754
|
+
} else {
|
|
7755
|
+
nextNode = nextSibling(node);
|
|
7756
|
+
}
|
|
7688
7757
|
mountComponent(
|
|
7689
7758
|
vnode,
|
|
7690
7759
|
container,
|
|
@@ -7694,10 +7763,6 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7694
7763
|
isSVGContainer(container),
|
|
7695
7764
|
optimized
|
|
7696
7765
|
);
|
|
7697
|
-
nextNode = isFragmentStart ? locateClosingAsyncAnchor(node) : nextSibling(node);
|
|
7698
|
-
if (nextNode && isComment(nextNode) && nextNode.data === "teleport end") {
|
|
7699
|
-
nextNode = nextSibling(nextNode);
|
|
7700
|
-
}
|
|
7701
7766
|
if (isAsyncWrapper(vnode)) {
|
|
7702
7767
|
let subTree;
|
|
7703
7768
|
if (isFragmentStart) {
|
|
@@ -7747,7 +7812,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7747
7812
|
};
|
|
7748
7813
|
const hydrateElement = (el, vnode, parentComponent, parentSuspense, slotScopeIds, optimized) => {
|
|
7749
7814
|
optimized = optimized || !!vnode.dynamicChildren;
|
|
7750
|
-
const { type, props, patchFlag, shapeFlag, dirs } = vnode;
|
|
7815
|
+
const { type, props, patchFlag, shapeFlag, dirs, transition } = vnode;
|
|
7751
7816
|
const forcePatchValue = type === "input" && dirs || type === "option";
|
|
7752
7817
|
if (!!(process.env.NODE_ENV !== "production") || forcePatchValue || patchFlag !== -1) {
|
|
7753
7818
|
if (dirs) {
|
|
@@ -7784,12 +7849,23 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7784
7849
|
if (vnodeHooks = props && props.onVnodeBeforeMount) {
|
|
7785
7850
|
invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
7786
7851
|
}
|
|
7852
|
+
let needCallTransitionHooks = false;
|
|
7853
|
+
if (isTemplateNode(el)) {
|
|
7854
|
+
needCallTransitionHooks = needTransition(parentSuspense, transition) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
7855
|
+
const content = el.content.firstChild;
|
|
7856
|
+
if (needCallTransitionHooks) {
|
|
7857
|
+
transition.beforeEnter(content);
|
|
7858
|
+
}
|
|
7859
|
+
replaceNode(content, el, parentComponent);
|
|
7860
|
+
vnode.el = el = content;
|
|
7861
|
+
}
|
|
7787
7862
|
if (dirs) {
|
|
7788
7863
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
7789
7864
|
}
|
|
7790
|
-
if ((vnodeHooks = props && props.onVnodeMounted) || dirs) {
|
|
7865
|
+
if ((vnodeHooks = props && props.onVnodeMounted) || dirs || needCallTransitionHooks) {
|
|
7791
7866
|
queueEffectWithSuspense(() => {
|
|
7792
7867
|
vnodeHooks && invokeVNodeHook(vnodeHooks, parentComponent, vnode);
|
|
7868
|
+
needCallTransitionHooks && transition.enter(el);
|
|
7793
7869
|
dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted");
|
|
7794
7870
|
}, parentSuspense);
|
|
7795
7871
|
}
|
|
@@ -7907,7 +7983,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7907
7983
|
);
|
|
7908
7984
|
vnode.el = null;
|
|
7909
7985
|
if (isFragment) {
|
|
7910
|
-
const end =
|
|
7986
|
+
const end = locateClosingAnchor(node);
|
|
7911
7987
|
while (true) {
|
|
7912
7988
|
const next2 = nextSibling(node);
|
|
7913
7989
|
if (next2 && next2 !== end) {
|
|
@@ -7932,14 +8008,14 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7932
8008
|
);
|
|
7933
8009
|
return next;
|
|
7934
8010
|
};
|
|
7935
|
-
const
|
|
8011
|
+
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
7936
8012
|
let match = 0;
|
|
7937
8013
|
while (node) {
|
|
7938
8014
|
node = nextSibling(node);
|
|
7939
8015
|
if (node && isComment(node)) {
|
|
7940
|
-
if (node.data ===
|
|
8016
|
+
if (node.data === open)
|
|
7941
8017
|
match++;
|
|
7942
|
-
if (node.data ===
|
|
8018
|
+
if (node.data === close) {
|
|
7943
8019
|
if (match === 0) {
|
|
7944
8020
|
return nextSibling(node);
|
|
7945
8021
|
} else {
|
|
@@ -7950,6 +8026,23 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
7950
8026
|
}
|
|
7951
8027
|
return node;
|
|
7952
8028
|
};
|
|
8029
|
+
const replaceNode = (newNode, oldNode, parentComponent) => {
|
|
8030
|
+
const parentNode2 = oldNode.parentNode;
|
|
8031
|
+
if (parentNode2) {
|
|
8032
|
+
parentNode2.replaceChild(newNode, oldNode);
|
|
8033
|
+
}
|
|
8034
|
+
let parent = parentComponent;
|
|
8035
|
+
while (parent) {
|
|
8036
|
+
if (parent.vnode.el === oldNode) {
|
|
8037
|
+
parent.vnode.el = newNode;
|
|
8038
|
+
parent.subTree.el = newNode;
|
|
8039
|
+
}
|
|
8040
|
+
parent = parent.parent;
|
|
8041
|
+
}
|
|
8042
|
+
};
|
|
8043
|
+
const isTemplateNode = (node) => {
|
|
8044
|
+
return node.nodeType === 1 /* ELEMENT */ && node.tagName.toLowerCase() === "template";
|
|
8045
|
+
};
|
|
7953
8046
|
return [hydrate, hydrateNode];
|
|
7954
8047
|
}
|
|
7955
8048
|
|
|
@@ -8300,7 +8393,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8300
8393
|
if (dirs) {
|
|
8301
8394
|
invokeDirectiveHook(vnode, null, parentComponent, "beforeMount");
|
|
8302
8395
|
}
|
|
8303
|
-
const needCallTransitionHooks = (
|
|
8396
|
+
const needCallTransitionHooks = needTransition(parentSuspense, transition);
|
|
8304
8397
|
if (needCallTransitionHooks) {
|
|
8305
8398
|
transition.beforeEnter(el);
|
|
8306
8399
|
}
|
|
@@ -8700,6 +8793,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8700
8793
|
} else {
|
|
8701
8794
|
instance.next = n2;
|
|
8702
8795
|
invalidateJob(instance.update);
|
|
8796
|
+
instance.effect.dirty = true;
|
|
8703
8797
|
instance.update();
|
|
8704
8798
|
}
|
|
8705
8799
|
} else {
|
|
@@ -8893,11 +8987,16 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8893
8987
|
};
|
|
8894
8988
|
const effect = instance.effect = new ReactiveEffect(
|
|
8895
8989
|
componentUpdateFn,
|
|
8990
|
+
NOOP,
|
|
8896
8991
|
() => queueJob(update),
|
|
8897
8992
|
instance.scope
|
|
8898
8993
|
// track it in component's effect scope
|
|
8899
8994
|
);
|
|
8900
|
-
const update = instance.update = () =>
|
|
8995
|
+
const update = instance.update = () => {
|
|
8996
|
+
if (effect.dirty) {
|
|
8997
|
+
effect.run();
|
|
8998
|
+
}
|
|
8999
|
+
};
|
|
8901
9000
|
update.id = instance.uid;
|
|
8902
9001
|
toggleRecurse(instance, true);
|
|
8903
9002
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
@@ -9228,8 +9327,8 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9228
9327
|
moveStaticNode(vnode, container, anchor);
|
|
9229
9328
|
return;
|
|
9230
9329
|
}
|
|
9231
|
-
const
|
|
9232
|
-
if (
|
|
9330
|
+
const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition;
|
|
9331
|
+
if (needTransition2) {
|
|
9233
9332
|
if (moveType === 0) {
|
|
9234
9333
|
transition.beforeEnter(el);
|
|
9235
9334
|
hostInsert(el, container, anchor);
|
|
@@ -9458,6 +9557,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
9458
9557
|
function toggleRecurse({ effect, update }, allowed) {
|
|
9459
9558
|
effect.allowRecurse = update.allowRecurse = allowed;
|
|
9460
9559
|
}
|
|
9560
|
+
function needTransition(parentSuspense, transition) {
|
|
9561
|
+
return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted;
|
|
9562
|
+
}
|
|
9461
9563
|
function traverseStaticChildren(n1, n2, shallow = false) {
|
|
9462
9564
|
const ch1 = n1.children;
|
|
9463
9565
|
const ch2 = n2.children;
|
|
@@ -10894,7 +10996,8 @@ function isMemoSame(cached, memo) {
|
|
|
10894
10996
|
return true;
|
|
10895
10997
|
}
|
|
10896
10998
|
|
|
10897
|
-
const version = "3.
|
|
10999
|
+
const version = "3.4.0-alpha.1";
|
|
11000
|
+
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
10898
11001
|
const _ssrUtils = {
|
|
10899
11002
|
createComponentInstance,
|
|
10900
11003
|
setupComponent,
|
|
@@ -12586,6 +12689,7 @@ var runtimeDom = /*#__PURE__*/Object.freeze({
|
|
|
12586
12689
|
BaseTransitionPropsValidators: BaseTransitionPropsValidators,
|
|
12587
12690
|
Comment: Comment,
|
|
12588
12691
|
EffectScope: EffectScope,
|
|
12692
|
+
ErrorTypeStrings: ErrorTypeStrings,
|
|
12589
12693
|
Fragment: Fragment,
|
|
12590
12694
|
KeepAlive: KeepAlive,
|
|
12591
12695
|
ReactiveEffect: ReactiveEffect,
|
|
@@ -14246,9 +14350,13 @@ function walk(node, context, doNotHoistNode = false) {
|
|
|
14246
14350
|
context.transformHoist(children, context, node);
|
|
14247
14351
|
}
|
|
14248
14352
|
if (hoistedCount && hoistedCount === originalCount && node.type === 1 && node.tagType === 0 && node.codegenNode && node.codegenNode.type === 13 && isArray(node.codegenNode.children)) {
|
|
14249
|
-
|
|
14353
|
+
const hoisted = context.hoist(
|
|
14250
14354
|
createArrayExpression(node.codegenNode.children)
|
|
14251
14355
|
);
|
|
14356
|
+
if (context.hmr) {
|
|
14357
|
+
hoisted.content = `[...${hoisted.content}]`;
|
|
14358
|
+
}
|
|
14359
|
+
node.codegenNode.children = hoisted;
|
|
14252
14360
|
}
|
|
14253
14361
|
}
|
|
14254
14362
|
function getConstantType(node, context) {
|
|
@@ -14422,6 +14530,7 @@ function createTransformContext(root, {
|
|
|
14422
14530
|
filename = "",
|
|
14423
14531
|
prefixIdentifiers = false,
|
|
14424
14532
|
hoistStatic: hoistStatic2 = false,
|
|
14533
|
+
hmr = false,
|
|
14425
14534
|
cacheHandlers = false,
|
|
14426
14535
|
nodeTransforms = [],
|
|
14427
14536
|
directiveTransforms = {},
|
|
@@ -14447,6 +14556,7 @@ function createTransformContext(root, {
|
|
|
14447
14556
|
selfName: nameMatch && capitalize(camelize(nameMatch[1])),
|
|
14448
14557
|
prefixIdentifiers,
|
|
14449
14558
|
hoistStatic: hoistStatic2,
|
|
14559
|
+
hmr,
|
|
14450
14560
|
cacheHandlers,
|
|
14451
14561
|
nodeTransforms,
|
|
14452
14562
|
directiveTransforms,
|
|
@@ -15830,7 +15940,7 @@ const trackSlotScopes = (node, context) => {
|
|
|
15830
15940
|
}
|
|
15831
15941
|
}
|
|
15832
15942
|
};
|
|
15833
|
-
const buildClientSlotFn = (props, children, loc) => createFunctionExpression(
|
|
15943
|
+
const buildClientSlotFn = (props, _vForExp, children, loc) => createFunctionExpression(
|
|
15834
15944
|
props,
|
|
15835
15945
|
children,
|
|
15836
15946
|
false,
|
|
@@ -15852,7 +15962,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15852
15962
|
slotsProperties.push(
|
|
15853
15963
|
createObjectProperty(
|
|
15854
15964
|
arg || createSimpleExpression("default", true),
|
|
15855
|
-
buildSlotFn(exp, children, loc)
|
|
15965
|
+
buildSlotFn(exp, void 0, children, loc)
|
|
15856
15966
|
)
|
|
15857
15967
|
);
|
|
15858
15968
|
}
|
|
@@ -15889,10 +15999,15 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15889
15999
|
} else {
|
|
15890
16000
|
hasDynamicSlots = true;
|
|
15891
16001
|
}
|
|
15892
|
-
const
|
|
16002
|
+
const vFor = findDir(slotElement, "for");
|
|
16003
|
+
const slotFunction = buildSlotFn(
|
|
16004
|
+
slotProps,
|
|
16005
|
+
vFor == null ? void 0 : vFor.exp,
|
|
16006
|
+
slotChildren,
|
|
16007
|
+
slotLoc
|
|
16008
|
+
);
|
|
15893
16009
|
let vIf;
|
|
15894
16010
|
let vElse;
|
|
15895
|
-
let vFor;
|
|
15896
16011
|
if (vIf = findDir(slotElement, "if")) {
|
|
15897
16012
|
hasDynamicSlots = true;
|
|
15898
16013
|
dynamicSlots.push(
|
|
@@ -15937,7 +16052,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15937
16052
|
createCompilerError(30, vElse.loc)
|
|
15938
16053
|
);
|
|
15939
16054
|
}
|
|
15940
|
-
} else if (vFor
|
|
16055
|
+
} else if (vFor) {
|
|
15941
16056
|
hasDynamicSlots = true;
|
|
15942
16057
|
const parseResult = vFor.parseResult || parseForExpression(vFor.exp, context);
|
|
15943
16058
|
if (parseResult) {
|
|
@@ -15978,7 +16093,7 @@ function buildSlots(node, context, buildSlotFn = buildClientSlotFn) {
|
|
|
15978
16093
|
}
|
|
15979
16094
|
if (!onComponentSlot) {
|
|
15980
16095
|
const buildDefaultSlotProperty = (props, children2) => {
|
|
15981
|
-
const fn = buildSlotFn(props, children2, loc);
|
|
16096
|
+
const fn = buildSlotFn(props, void 0, children2, loc);
|
|
15982
16097
|
if (context.compatConfig) {
|
|
15983
16098
|
fn.isNonScopedSlot = true;
|
|
15984
16099
|
}
|
|
@@ -17774,4 +17889,4 @@ var Vue$1 = Vue;
|
|
|
17774
17889
|
|
|
17775
17890
|
const { configureCompat } = Vue$1;
|
|
17776
17891
|
|
|
17777
|
-
export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|
|
17892
|
+
export { BaseTransition, BaseTransitionPropsValidators, Comment, EffectScope, ErrorTypeStrings, Fragment, KeepAlive, ReactiveEffect, Static, Suspense, Teleport, Text, Transition, TransitionGroup, VueElement, assertNumber, callWithAsyncErrorHandling, callWithErrorHandling, camelize, capitalize, cloneVNode, compatUtils, computed, configureCompat, createApp, createBlock, createCommentVNode, createElementBlock, createBaseVNode as createElementVNode, createHydrationRenderer, createPropsRestProxy, createRenderer, createSSRApp, createSlots, createStaticVNode, createTextVNode, createVNode, customRef, Vue$1 as default, defineAsyncComponent, defineComponent, defineCustomElement, defineEmits, defineExpose, defineModel, defineOptions, defineProps, defineSSRCustomElement, defineSlots, devtools, effect, effectScope, getCurrentInstance, getCurrentScope, getTransitionRawChildren, guardReactiveProps, h, handleError, hasInjectionContext, hydrate, initCustomFormatter, initDirectivesForSSR, inject, isMemoSame, isProxy, isReactive, isReadonly, isRef, isRuntimeOnly, isShallow, isVNode, markRaw, mergeDefaults, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onActivated, onBeforeMount, onBeforeUnmount, onBeforeUpdate, onDeactivated, onErrorCaptured, onMounted, onRenderTracked, onRenderTriggered, onScopeDispose, onServerPrefetch, onUnmounted, onUpdated, openBlock, popScopeId, provide, proxyRefs, pushScopeId, queuePostFlushCb, reactive, readonly, ref, registerRuntimeCompiler, render, renderList, renderSlot, resolveComponent, resolveDirective, resolveDynamicComponent, resolveFilter, resolveTransitionHooks, setBlockTracking, setDevtoolsHook, setTransitionHooks, shallowReactive, shallowReadonly, shallowRef, ssrContextKey, ssrUtils, stop, toDisplayString, toHandlerKey, toHandlers, toRaw, toRef, toRefs, toValue, transformVNodeArgs, triggerRef, unref, useAttrs, useCssModule, useCssVars, useModel, useSSRContext, useSlots, useTransitionState, vModelCheckbox, vModelDynamic, vModelRadio, vModelSelect, vModelText, vShow, version, warn, watch, watchEffect, watchPostEffect, watchSyncEffect, withAsyncContext, withCtx, withDefaults, withDirectives, withKeys, withMemo, withModifiers, withScopeId };
|