vue 3.5.11 → 3.5.13
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/README.md +1 -1
- package/dist/vue.cjs.js +1 -1
- package/dist/vue.cjs.prod.js +1 -1
- package/dist/vue.esm-browser.js +288 -262
- package/dist/vue.esm-browser.prod.js +6 -6
- package/dist/vue.esm-bundler.js +1 -1
- package/dist/vue.global.js +279 -258
- package/dist/vue.global.prod.js +6 -6
- package/dist/vue.runtime.esm-browser.js +269 -253
- package/dist/vue.runtime.esm-browser.prod.js +2 -2
- package/dist/vue.runtime.esm-bundler.js +1 -1
- package/dist/vue.runtime.global.js +260 -249
- package/dist/vue.runtime.global.prod.js +2 -2
- package/package.json +6 -6
package/dist/vue.esm-browser.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* vue v3.5.
|
|
2
|
+
* vue v3.5.13
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -212,10 +212,9 @@ function parseStringStyle(cssText) {
|
|
|
212
212
|
return ret;
|
|
213
213
|
}
|
|
214
214
|
function stringifyStyle(styles) {
|
|
215
|
+
if (!styles) return "";
|
|
216
|
+
if (isString(styles)) return styles;
|
|
215
217
|
let ret = "";
|
|
216
|
-
if (!styles || isString(styles)) {
|
|
217
|
-
return ret;
|
|
218
|
-
}
|
|
219
218
|
for (const key in styles) {
|
|
220
219
|
const value = styles[key];
|
|
221
220
|
if (isString(value) || typeof value === "number") {
|
|
@@ -478,17 +477,21 @@ class EffectScope {
|
|
|
478
477
|
}
|
|
479
478
|
stop(fromParent) {
|
|
480
479
|
if (this._active) {
|
|
480
|
+
this._active = false;
|
|
481
481
|
let i, l;
|
|
482
482
|
for (i = 0, l = this.effects.length; i < l; i++) {
|
|
483
483
|
this.effects[i].stop();
|
|
484
484
|
}
|
|
485
|
+
this.effects.length = 0;
|
|
485
486
|
for (i = 0, l = this.cleanups.length; i < l; i++) {
|
|
486
487
|
this.cleanups[i]();
|
|
487
488
|
}
|
|
489
|
+
this.cleanups.length = 0;
|
|
488
490
|
if (this.scopes) {
|
|
489
491
|
for (i = 0, l = this.scopes.length; i < l; i++) {
|
|
490
492
|
this.scopes[i].stop(true);
|
|
491
493
|
}
|
|
494
|
+
this.scopes.length = 0;
|
|
492
495
|
}
|
|
493
496
|
if (!this.detached && this.parent && !fromParent) {
|
|
494
497
|
const last = this.parent.scopes.pop();
|
|
@@ -498,7 +501,6 @@ class EffectScope {
|
|
|
498
501
|
}
|
|
499
502
|
}
|
|
500
503
|
this.parent = void 0;
|
|
501
|
-
this._active = false;
|
|
502
504
|
}
|
|
503
505
|
}
|
|
504
506
|
}
|
|
@@ -763,16 +765,16 @@ function removeSub(link, soft = false) {
|
|
|
763
765
|
nextSub.prevSub = prevSub;
|
|
764
766
|
link.nextSub = void 0;
|
|
765
767
|
}
|
|
766
|
-
if (dep.subs === link) {
|
|
767
|
-
dep.subs = prevSub;
|
|
768
|
-
}
|
|
769
768
|
if (dep.subsHead === link) {
|
|
770
769
|
dep.subsHead = nextSub;
|
|
771
770
|
}
|
|
772
|
-
if (
|
|
773
|
-
dep.
|
|
774
|
-
|
|
775
|
-
|
|
771
|
+
if (dep.subs === link) {
|
|
772
|
+
dep.subs = prevSub;
|
|
773
|
+
if (!prevSub && dep.computed) {
|
|
774
|
+
dep.computed.flags &= ~4;
|
|
775
|
+
for (let l = dep.computed.deps; l; l = l.nextDep) {
|
|
776
|
+
removeSub(l, true);
|
|
777
|
+
}
|
|
776
778
|
}
|
|
777
779
|
}
|
|
778
780
|
if (!soft && !--dep.sc && dep.map) {
|
|
@@ -1032,7 +1034,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
|
|
|
1032
1034
|
}
|
|
1033
1035
|
});
|
|
1034
1036
|
} else {
|
|
1035
|
-
if (key !== void 0) {
|
|
1037
|
+
if (key !== void 0 || depsMap.has(void 0)) {
|
|
1036
1038
|
run(depsMap.get(key));
|
|
1037
1039
|
}
|
|
1038
1040
|
if (isArrayIndex) {
|
|
@@ -1264,6 +1266,7 @@ class BaseReactiveHandler {
|
|
|
1264
1266
|
this._isShallow = _isShallow;
|
|
1265
1267
|
}
|
|
1266
1268
|
get(target, key, receiver) {
|
|
1269
|
+
if (key === "__v_skip") return target["__v_skip"];
|
|
1267
1270
|
const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow;
|
|
1268
1271
|
if (key === "__v_isReactive") {
|
|
1269
1272
|
return !isReadonly2;
|
|
@@ -1407,117 +1410,6 @@ const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true
|
|
|
1407
1410
|
|
|
1408
1411
|
const toShallow = (value) => value;
|
|
1409
1412
|
const getProto = (v) => Reflect.getPrototypeOf(v);
|
|
1410
|
-
function get(target, key, isReadonly2 = false, isShallow2 = false) {
|
|
1411
|
-
target = target["__v_raw"];
|
|
1412
|
-
const rawTarget = toRaw(target);
|
|
1413
|
-
const rawKey = toRaw(key);
|
|
1414
|
-
if (!isReadonly2) {
|
|
1415
|
-
if (hasChanged(key, rawKey)) {
|
|
1416
|
-
track(rawTarget, "get", key);
|
|
1417
|
-
}
|
|
1418
|
-
track(rawTarget, "get", rawKey);
|
|
1419
|
-
}
|
|
1420
|
-
const { has: has2 } = getProto(rawTarget);
|
|
1421
|
-
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
1422
|
-
if (has2.call(rawTarget, key)) {
|
|
1423
|
-
return wrap(target.get(key));
|
|
1424
|
-
} else if (has2.call(rawTarget, rawKey)) {
|
|
1425
|
-
return wrap(target.get(rawKey));
|
|
1426
|
-
} else if (target !== rawTarget) {
|
|
1427
|
-
target.get(key);
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
function has(key, isReadonly2 = false) {
|
|
1431
|
-
const target = this["__v_raw"];
|
|
1432
|
-
const rawTarget = toRaw(target);
|
|
1433
|
-
const rawKey = toRaw(key);
|
|
1434
|
-
if (!isReadonly2) {
|
|
1435
|
-
if (hasChanged(key, rawKey)) {
|
|
1436
|
-
track(rawTarget, "has", key);
|
|
1437
|
-
}
|
|
1438
|
-
track(rawTarget, "has", rawKey);
|
|
1439
|
-
}
|
|
1440
|
-
return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
|
|
1441
|
-
}
|
|
1442
|
-
function size(target, isReadonly2 = false) {
|
|
1443
|
-
target = target["__v_raw"];
|
|
1444
|
-
!isReadonly2 && track(toRaw(target), "iterate", ITERATE_KEY);
|
|
1445
|
-
return Reflect.get(target, "size", target);
|
|
1446
|
-
}
|
|
1447
|
-
function add(value, _isShallow = false) {
|
|
1448
|
-
if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
|
|
1449
|
-
value = toRaw(value);
|
|
1450
|
-
}
|
|
1451
|
-
const target = toRaw(this);
|
|
1452
|
-
const proto = getProto(target);
|
|
1453
|
-
const hadKey = proto.has.call(target, value);
|
|
1454
|
-
if (!hadKey) {
|
|
1455
|
-
target.add(value);
|
|
1456
|
-
trigger(target, "add", value, value);
|
|
1457
|
-
}
|
|
1458
|
-
return this;
|
|
1459
|
-
}
|
|
1460
|
-
function set(key, value, _isShallow = false) {
|
|
1461
|
-
if (!_isShallow && !isShallow(value) && !isReadonly(value)) {
|
|
1462
|
-
value = toRaw(value);
|
|
1463
|
-
}
|
|
1464
|
-
const target = toRaw(this);
|
|
1465
|
-
const { has: has2, get: get2 } = getProto(target);
|
|
1466
|
-
let hadKey = has2.call(target, key);
|
|
1467
|
-
if (!hadKey) {
|
|
1468
|
-
key = toRaw(key);
|
|
1469
|
-
hadKey = has2.call(target, key);
|
|
1470
|
-
} else {
|
|
1471
|
-
checkIdentityKeys(target, has2, key);
|
|
1472
|
-
}
|
|
1473
|
-
const oldValue = get2.call(target, key);
|
|
1474
|
-
target.set(key, value);
|
|
1475
|
-
if (!hadKey) {
|
|
1476
|
-
trigger(target, "add", key, value);
|
|
1477
|
-
} else if (hasChanged(value, oldValue)) {
|
|
1478
|
-
trigger(target, "set", key, value, oldValue);
|
|
1479
|
-
}
|
|
1480
|
-
return this;
|
|
1481
|
-
}
|
|
1482
|
-
function deleteEntry(key) {
|
|
1483
|
-
const target = toRaw(this);
|
|
1484
|
-
const { has: has2, get: get2 } = getProto(target);
|
|
1485
|
-
let hadKey = has2.call(target, key);
|
|
1486
|
-
if (!hadKey) {
|
|
1487
|
-
key = toRaw(key);
|
|
1488
|
-
hadKey = has2.call(target, key);
|
|
1489
|
-
} else {
|
|
1490
|
-
checkIdentityKeys(target, has2, key);
|
|
1491
|
-
}
|
|
1492
|
-
const oldValue = get2 ? get2.call(target, key) : void 0;
|
|
1493
|
-
const result = target.delete(key);
|
|
1494
|
-
if (hadKey) {
|
|
1495
|
-
trigger(target, "delete", key, void 0, oldValue);
|
|
1496
|
-
}
|
|
1497
|
-
return result;
|
|
1498
|
-
}
|
|
1499
|
-
function clear() {
|
|
1500
|
-
const target = toRaw(this);
|
|
1501
|
-
const hadItems = target.size !== 0;
|
|
1502
|
-
const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
|
|
1503
|
-
const result = target.clear();
|
|
1504
|
-
if (hadItems) {
|
|
1505
|
-
trigger(target, "clear", void 0, void 0, oldTarget);
|
|
1506
|
-
}
|
|
1507
|
-
return result;
|
|
1508
|
-
}
|
|
1509
|
-
function createForEach(isReadonly2, isShallow2) {
|
|
1510
|
-
return function forEach(callback, thisArg) {
|
|
1511
|
-
const observed = this;
|
|
1512
|
-
const target = observed["__v_raw"];
|
|
1513
|
-
const rawTarget = toRaw(target);
|
|
1514
|
-
const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive;
|
|
1515
|
-
!isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY);
|
|
1516
|
-
return target.forEach((value, key) => {
|
|
1517
|
-
return callback.call(thisArg, wrap(value), wrap(key), observed);
|
|
1518
|
-
});
|
|
1519
|
-
};
|
|
1520
|
-
}
|
|
1521
1413
|
function createIterableMethod(method, isReadonly2, isShallow2) {
|
|
1522
1414
|
return function(...args) {
|
|
1523
1415
|
const target = this["__v_raw"];
|
|
@@ -1560,71 +1452,134 @@ function createReadonlyMethod(type) {
|
|
|
1560
1452
|
return type === "delete" ? false : type === "clear" ? void 0 : this;
|
|
1561
1453
|
};
|
|
1562
1454
|
}
|
|
1563
|
-
function createInstrumentations() {
|
|
1564
|
-
const
|
|
1565
|
-
get(key) {
|
|
1566
|
-
return get(this, key);
|
|
1567
|
-
},
|
|
1568
|
-
get size() {
|
|
1569
|
-
return size(this);
|
|
1570
|
-
},
|
|
1571
|
-
has,
|
|
1572
|
-
add,
|
|
1573
|
-
set,
|
|
1574
|
-
delete: deleteEntry,
|
|
1575
|
-
clear,
|
|
1576
|
-
forEach: createForEach(false, false)
|
|
1577
|
-
};
|
|
1578
|
-
const shallowInstrumentations2 = {
|
|
1579
|
-
get(key) {
|
|
1580
|
-
return get(this, key, false, true);
|
|
1581
|
-
},
|
|
1582
|
-
get size() {
|
|
1583
|
-
return size(this);
|
|
1584
|
-
},
|
|
1585
|
-
has,
|
|
1586
|
-
add(value) {
|
|
1587
|
-
return add.call(this, value, true);
|
|
1588
|
-
},
|
|
1589
|
-
set(key, value) {
|
|
1590
|
-
return set.call(this, key, value, true);
|
|
1591
|
-
},
|
|
1592
|
-
delete: deleteEntry,
|
|
1593
|
-
clear,
|
|
1594
|
-
forEach: createForEach(false, true)
|
|
1595
|
-
};
|
|
1596
|
-
const readonlyInstrumentations2 = {
|
|
1455
|
+
function createInstrumentations(readonly, shallow) {
|
|
1456
|
+
const instrumentations = {
|
|
1597
1457
|
get(key) {
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1458
|
+
const target = this["__v_raw"];
|
|
1459
|
+
const rawTarget = toRaw(target);
|
|
1460
|
+
const rawKey = toRaw(key);
|
|
1461
|
+
if (!readonly) {
|
|
1462
|
+
if (hasChanged(key, rawKey)) {
|
|
1463
|
+
track(rawTarget, "get", key);
|
|
1464
|
+
}
|
|
1465
|
+
track(rawTarget, "get", rawKey);
|
|
1466
|
+
}
|
|
1467
|
+
const { has } = getProto(rawTarget);
|
|
1468
|
+
const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
|
|
1469
|
+
if (has.call(rawTarget, key)) {
|
|
1470
|
+
return wrap(target.get(key));
|
|
1471
|
+
} else if (has.call(rawTarget, rawKey)) {
|
|
1472
|
+
return wrap(target.get(rawKey));
|
|
1473
|
+
} else if (target !== rawTarget) {
|
|
1474
|
+
target.get(key);
|
|
1475
|
+
}
|
|
1615
1476
|
},
|
|
1616
1477
|
get size() {
|
|
1617
|
-
|
|
1478
|
+
const target = this["__v_raw"];
|
|
1479
|
+
!readonly && track(toRaw(target), "iterate", ITERATE_KEY);
|
|
1480
|
+
return Reflect.get(target, "size", target);
|
|
1618
1481
|
},
|
|
1619
1482
|
has(key) {
|
|
1620
|
-
|
|
1483
|
+
const target = this["__v_raw"];
|
|
1484
|
+
const rawTarget = toRaw(target);
|
|
1485
|
+
const rawKey = toRaw(key);
|
|
1486
|
+
if (!readonly) {
|
|
1487
|
+
if (hasChanged(key, rawKey)) {
|
|
1488
|
+
track(rawTarget, "has", key);
|
|
1489
|
+
}
|
|
1490
|
+
track(rawTarget, "has", rawKey);
|
|
1491
|
+
}
|
|
1492
|
+
return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey);
|
|
1621
1493
|
},
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1494
|
+
forEach(callback, thisArg) {
|
|
1495
|
+
const observed = this;
|
|
1496
|
+
const target = observed["__v_raw"];
|
|
1497
|
+
const rawTarget = toRaw(target);
|
|
1498
|
+
const wrap = shallow ? toShallow : readonly ? toReadonly : toReactive;
|
|
1499
|
+
!readonly && track(rawTarget, "iterate", ITERATE_KEY);
|
|
1500
|
+
return target.forEach((value, key) => {
|
|
1501
|
+
return callback.call(thisArg, wrap(value), wrap(key), observed);
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1627
1504
|
};
|
|
1505
|
+
extend(
|
|
1506
|
+
instrumentations,
|
|
1507
|
+
readonly ? {
|
|
1508
|
+
add: createReadonlyMethod("add"),
|
|
1509
|
+
set: createReadonlyMethod("set"),
|
|
1510
|
+
delete: createReadonlyMethod("delete"),
|
|
1511
|
+
clear: createReadonlyMethod("clear")
|
|
1512
|
+
} : {
|
|
1513
|
+
add(value) {
|
|
1514
|
+
if (!shallow && !isShallow(value) && !isReadonly(value)) {
|
|
1515
|
+
value = toRaw(value);
|
|
1516
|
+
}
|
|
1517
|
+
const target = toRaw(this);
|
|
1518
|
+
const proto = getProto(target);
|
|
1519
|
+
const hadKey = proto.has.call(target, value);
|
|
1520
|
+
if (!hadKey) {
|
|
1521
|
+
target.add(value);
|
|
1522
|
+
trigger(target, "add", value, value);
|
|
1523
|
+
}
|
|
1524
|
+
return this;
|
|
1525
|
+
},
|
|
1526
|
+
set(key, value) {
|
|
1527
|
+
if (!shallow && !isShallow(value) && !isReadonly(value)) {
|
|
1528
|
+
value = toRaw(value);
|
|
1529
|
+
}
|
|
1530
|
+
const target = toRaw(this);
|
|
1531
|
+
const { has, get } = getProto(target);
|
|
1532
|
+
let hadKey = has.call(target, key);
|
|
1533
|
+
if (!hadKey) {
|
|
1534
|
+
key = toRaw(key);
|
|
1535
|
+
hadKey = has.call(target, key);
|
|
1536
|
+
} else {
|
|
1537
|
+
checkIdentityKeys(target, has, key);
|
|
1538
|
+
}
|
|
1539
|
+
const oldValue = get.call(target, key);
|
|
1540
|
+
target.set(key, value);
|
|
1541
|
+
if (!hadKey) {
|
|
1542
|
+
trigger(target, "add", key, value);
|
|
1543
|
+
} else if (hasChanged(value, oldValue)) {
|
|
1544
|
+
trigger(target, "set", key, value, oldValue);
|
|
1545
|
+
}
|
|
1546
|
+
return this;
|
|
1547
|
+
},
|
|
1548
|
+
delete(key) {
|
|
1549
|
+
const target = toRaw(this);
|
|
1550
|
+
const { has, get } = getProto(target);
|
|
1551
|
+
let hadKey = has.call(target, key);
|
|
1552
|
+
if (!hadKey) {
|
|
1553
|
+
key = toRaw(key);
|
|
1554
|
+
hadKey = has.call(target, key);
|
|
1555
|
+
} else {
|
|
1556
|
+
checkIdentityKeys(target, has, key);
|
|
1557
|
+
}
|
|
1558
|
+
const oldValue = get ? get.call(target, key) : void 0;
|
|
1559
|
+
const result = target.delete(key);
|
|
1560
|
+
if (hadKey) {
|
|
1561
|
+
trigger(target, "delete", key, void 0, oldValue);
|
|
1562
|
+
}
|
|
1563
|
+
return result;
|
|
1564
|
+
},
|
|
1565
|
+
clear() {
|
|
1566
|
+
const target = toRaw(this);
|
|
1567
|
+
const hadItems = target.size !== 0;
|
|
1568
|
+
const oldTarget = isMap(target) ? new Map(target) : new Set(target) ;
|
|
1569
|
+
const result = target.clear();
|
|
1570
|
+
if (hadItems) {
|
|
1571
|
+
trigger(
|
|
1572
|
+
target,
|
|
1573
|
+
"clear",
|
|
1574
|
+
void 0,
|
|
1575
|
+
void 0,
|
|
1576
|
+
oldTarget
|
|
1577
|
+
);
|
|
1578
|
+
}
|
|
1579
|
+
return result;
|
|
1580
|
+
}
|
|
1581
|
+
}
|
|
1582
|
+
);
|
|
1628
1583
|
const iteratorMethods = [
|
|
1629
1584
|
"keys",
|
|
1630
1585
|
"values",
|
|
@@ -1632,30 +1587,12 @@ function createInstrumentations() {
|
|
|
1632
1587
|
Symbol.iterator
|
|
1633
1588
|
];
|
|
1634
1589
|
iteratorMethods.forEach((method) => {
|
|
1635
|
-
|
|
1636
|
-
readonlyInstrumentations2[method] = createIterableMethod(method, true, false);
|
|
1637
|
-
shallowInstrumentations2[method] = createIterableMethod(method, false, true);
|
|
1638
|
-
shallowReadonlyInstrumentations2[method] = createIterableMethod(
|
|
1639
|
-
method,
|
|
1640
|
-
true,
|
|
1641
|
-
true
|
|
1642
|
-
);
|
|
1590
|
+
instrumentations[method] = createIterableMethod(method, readonly, shallow);
|
|
1643
1591
|
});
|
|
1644
|
-
return
|
|
1645
|
-
mutableInstrumentations2,
|
|
1646
|
-
readonlyInstrumentations2,
|
|
1647
|
-
shallowInstrumentations2,
|
|
1648
|
-
shallowReadonlyInstrumentations2
|
|
1649
|
-
];
|
|
1592
|
+
return instrumentations;
|
|
1650
1593
|
}
|
|
1651
|
-
const [
|
|
1652
|
-
mutableInstrumentations,
|
|
1653
|
-
readonlyInstrumentations,
|
|
1654
|
-
shallowInstrumentations,
|
|
1655
|
-
shallowReadonlyInstrumentations
|
|
1656
|
-
] = /* @__PURE__ */ createInstrumentations();
|
|
1657
1594
|
function createInstrumentationGetter(isReadonly2, shallow) {
|
|
1658
|
-
const instrumentations =
|
|
1595
|
+
const instrumentations = createInstrumentations(isReadonly2, shallow);
|
|
1659
1596
|
return (target, key, receiver) => {
|
|
1660
1597
|
if (key === "__v_isReactive") {
|
|
1661
1598
|
return !isReadonly2;
|
|
@@ -1683,9 +1620,9 @@ const readonlyCollectionHandlers = {
|
|
|
1683
1620
|
const shallowReadonlyCollectionHandlers = {
|
|
1684
1621
|
get: /* @__PURE__ */ createInstrumentationGetter(true, true)
|
|
1685
1622
|
};
|
|
1686
|
-
function checkIdentityKeys(target,
|
|
1623
|
+
function checkIdentityKeys(target, has, key) {
|
|
1687
1624
|
const rawKey = toRaw(key);
|
|
1688
|
-
if (rawKey !== key &&
|
|
1625
|
+
if (rawKey !== key && has.call(target, rawKey)) {
|
|
1689
1626
|
const type = toRawType(target);
|
|
1690
1627
|
warn$2(
|
|
1691
1628
|
`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
|
|
@@ -2166,7 +2103,7 @@ function watch$1(source, cb, options = EMPTY_OBJ) {
|
|
|
2166
2103
|
const scope = getCurrentScope();
|
|
2167
2104
|
const watchHandle = () => {
|
|
2168
2105
|
effect.stop();
|
|
2169
|
-
if (scope) {
|
|
2106
|
+
if (scope && scope.active) {
|
|
2170
2107
|
remove(scope.effects, effect);
|
|
2171
2108
|
}
|
|
2172
2109
|
};
|
|
@@ -3111,7 +3048,7 @@ const TeleportImpl = {
|
|
|
3111
3048
|
}
|
|
3112
3049
|
if (!disabled) {
|
|
3113
3050
|
mount(target, targetAnchor);
|
|
3114
|
-
updateCssVars(n2);
|
|
3051
|
+
updateCssVars(n2, false);
|
|
3115
3052
|
}
|
|
3116
3053
|
} else if (!disabled) {
|
|
3117
3054
|
warn$1(
|
|
@@ -3123,14 +3060,35 @@ const TeleportImpl = {
|
|
|
3123
3060
|
};
|
|
3124
3061
|
if (disabled) {
|
|
3125
3062
|
mount(container, mainAnchor);
|
|
3126
|
-
updateCssVars(n2);
|
|
3063
|
+
updateCssVars(n2, true);
|
|
3127
3064
|
}
|
|
3128
3065
|
if (isTeleportDeferred(n2.props)) {
|
|
3129
|
-
queuePostRenderEffect(
|
|
3066
|
+
queuePostRenderEffect(() => {
|
|
3067
|
+
mountToTarget();
|
|
3068
|
+
n2.el.__isMounted = true;
|
|
3069
|
+
}, parentSuspense);
|
|
3130
3070
|
} else {
|
|
3131
3071
|
mountToTarget();
|
|
3132
3072
|
}
|
|
3133
3073
|
} else {
|
|
3074
|
+
if (isTeleportDeferred(n2.props) && !n1.el.__isMounted) {
|
|
3075
|
+
queuePostRenderEffect(() => {
|
|
3076
|
+
TeleportImpl.process(
|
|
3077
|
+
n1,
|
|
3078
|
+
n2,
|
|
3079
|
+
container,
|
|
3080
|
+
anchor,
|
|
3081
|
+
parentComponent,
|
|
3082
|
+
parentSuspense,
|
|
3083
|
+
namespace,
|
|
3084
|
+
slotScopeIds,
|
|
3085
|
+
optimized,
|
|
3086
|
+
internals
|
|
3087
|
+
);
|
|
3088
|
+
delete n1.el.__isMounted;
|
|
3089
|
+
}, parentSuspense);
|
|
3090
|
+
return;
|
|
3091
|
+
}
|
|
3134
3092
|
n2.el = n1.el;
|
|
3135
3093
|
n2.targetStart = n1.targetStart;
|
|
3136
3094
|
const mainAnchor = n2.anchor = n1.anchor;
|
|
@@ -3213,7 +3171,7 @@ const TeleportImpl = {
|
|
|
3213
3171
|
);
|
|
3214
3172
|
}
|
|
3215
3173
|
}
|
|
3216
|
-
updateCssVars(n2);
|
|
3174
|
+
updateCssVars(n2, disabled);
|
|
3217
3175
|
}
|
|
3218
3176
|
},
|
|
3219
3177
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
@@ -3281,9 +3239,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
3281
3239
|
querySelector
|
|
3282
3240
|
);
|
|
3283
3241
|
if (target) {
|
|
3242
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
3284
3243
|
const targetNode = target._lpa || target.firstChild;
|
|
3285
3244
|
if (vnode.shapeFlag & 16) {
|
|
3286
|
-
if (
|
|
3245
|
+
if (disabled) {
|
|
3287
3246
|
vnode.anchor = hydrateChildren(
|
|
3288
3247
|
nextSibling(node),
|
|
3289
3248
|
vnode,
|
|
@@ -3324,16 +3283,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
3324
3283
|
);
|
|
3325
3284
|
}
|
|
3326
3285
|
}
|
|
3327
|
-
updateCssVars(vnode);
|
|
3286
|
+
updateCssVars(vnode, disabled);
|
|
3328
3287
|
}
|
|
3329
3288
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
3330
3289
|
}
|
|
3331
3290
|
const Teleport = TeleportImpl;
|
|
3332
|
-
function updateCssVars(vnode) {
|
|
3291
|
+
function updateCssVars(vnode, isDisabled) {
|
|
3333
3292
|
const ctx = vnode.ctx;
|
|
3334
3293
|
if (ctx && ctx.ut) {
|
|
3335
|
-
let node
|
|
3336
|
-
|
|
3294
|
+
let node, anchor;
|
|
3295
|
+
if (isDisabled) {
|
|
3296
|
+
node = vnode.el;
|
|
3297
|
+
anchor = vnode.anchor;
|
|
3298
|
+
} else {
|
|
3299
|
+
node = vnode.targetStart;
|
|
3300
|
+
anchor = vnode.targetAnchor;
|
|
3301
|
+
}
|
|
3302
|
+
while (node && node !== anchor) {
|
|
3337
3303
|
if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
|
|
3338
3304
|
node = node.nextSibling;
|
|
3339
3305
|
}
|
|
@@ -3428,10 +3394,9 @@ const BaseTransitionImpl = {
|
|
|
3428
3394
|
if (innerChild.type !== Comment) {
|
|
3429
3395
|
setTransitionHooks(innerChild, enterHooks);
|
|
3430
3396
|
}
|
|
3431
|
-
|
|
3432
|
-
const oldInnerChild = oldChild && getInnerChild$1(oldChild);
|
|
3397
|
+
let oldInnerChild = instance.subTree && getInnerChild$1(instance.subTree);
|
|
3433
3398
|
if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
|
|
3434
|
-
|
|
3399
|
+
let leavingHooks = resolveTransitionHooks(
|
|
3435
3400
|
oldInnerChild,
|
|
3436
3401
|
rawProps,
|
|
3437
3402
|
state,
|
|
@@ -3446,6 +3411,7 @@ const BaseTransitionImpl = {
|
|
|
3446
3411
|
instance.update();
|
|
3447
3412
|
}
|
|
3448
3413
|
delete leavingHooks.afterLeave;
|
|
3414
|
+
oldInnerChild = void 0;
|
|
3449
3415
|
};
|
|
3450
3416
|
return emptyPlaceholder(child);
|
|
3451
3417
|
} else if (mode === "in-out" && innerChild.type !== Comment) {
|
|
@@ -3459,10 +3425,19 @@ const BaseTransitionImpl = {
|
|
|
3459
3425
|
earlyRemove();
|
|
3460
3426
|
el[leaveCbKey] = void 0;
|
|
3461
3427
|
delete enterHooks.delayedLeave;
|
|
3428
|
+
oldInnerChild = void 0;
|
|
3429
|
+
};
|
|
3430
|
+
enterHooks.delayedLeave = () => {
|
|
3431
|
+
delayedLeave();
|
|
3432
|
+
delete enterHooks.delayedLeave;
|
|
3433
|
+
oldInnerChild = void 0;
|
|
3462
3434
|
};
|
|
3463
|
-
enterHooks.delayedLeave = delayedLeave;
|
|
3464
3435
|
};
|
|
3436
|
+
} else {
|
|
3437
|
+
oldInnerChild = void 0;
|
|
3465
3438
|
}
|
|
3439
|
+
} else if (oldInnerChild) {
|
|
3440
|
+
oldInnerChild = void 0;
|
|
3466
3441
|
}
|
|
3467
3442
|
return child;
|
|
3468
3443
|
};
|
|
@@ -3767,6 +3742,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3767
3742
|
return;
|
|
3768
3743
|
}
|
|
3769
3744
|
if (isAsyncWrapper(vnode) && !isUnmount) {
|
|
3745
|
+
if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) {
|
|
3746
|
+
setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree);
|
|
3747
|
+
}
|
|
3770
3748
|
return;
|
|
3771
3749
|
}
|
|
3772
3750
|
const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el;
|
|
@@ -3783,8 +3761,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3783
3761
|
const setupState = owner.setupState;
|
|
3784
3762
|
const rawSetupState = toRaw(setupState);
|
|
3785
3763
|
const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
|
|
3786
|
-
|
|
3787
|
-
|
|
3764
|
+
{
|
|
3765
|
+
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
|
|
3766
|
+
warn$1(
|
|
3767
|
+
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
3768
|
+
);
|
|
3769
|
+
}
|
|
3770
|
+
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
3771
|
+
return false;
|
|
3772
|
+
}
|
|
3788
3773
|
}
|
|
3789
3774
|
return hasOwn(rawSetupState, key);
|
|
3790
3775
|
};
|
|
@@ -4024,7 +4009,7 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4024
4009
|
getContainerType(container),
|
|
4025
4010
|
optimized
|
|
4026
4011
|
);
|
|
4027
|
-
if (isAsyncWrapper(vnode)) {
|
|
4012
|
+
if (isAsyncWrapper(vnode) && !vnode.type.__asyncResolved) {
|
|
4028
4013
|
let subTree;
|
|
4029
4014
|
if (isFragmentStart) {
|
|
4030
4015
|
subTree = createVNode(Fragment);
|
|
@@ -4081,7 +4066,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
4081
4066
|
}
|
|
4082
4067
|
let needCallTransitionHooks = false;
|
|
4083
4068
|
if (isTemplateNode(el)) {
|
|
4084
|
-
needCallTransitionHooks = needTransition(
|
|
4069
|
+
needCallTransitionHooks = needTransition(
|
|
4070
|
+
null,
|
|
4071
|
+
// no need check parentSuspense in hydration
|
|
4072
|
+
transition
|
|
4073
|
+
) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
4085
4074
|
const content = el.content.firstChild;
|
|
4086
4075
|
if (needCallTransitionHooks) {
|
|
4087
4076
|
transition.beforeEnter(content);
|
|
@@ -4289,6 +4278,10 @@ Server rendered element contains fewer child nodes than client vdom.`
|
|
|
4289
4278
|
getContainerType(container),
|
|
4290
4279
|
slotScopeIds
|
|
4291
4280
|
);
|
|
4281
|
+
if (parentComponent) {
|
|
4282
|
+
parentComponent.vnode.el = vnode.el;
|
|
4283
|
+
updateHOCHostEl(parentComponent, vnode.el);
|
|
4284
|
+
}
|
|
4292
4285
|
return next;
|
|
4293
4286
|
};
|
|
4294
4287
|
const locateClosingAnchor = (node, open = "[", close = "]") => {
|
|
@@ -4474,6 +4467,8 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
4474
4467
|
}
|
|
4475
4468
|
}
|
|
4476
4469
|
|
|
4470
|
+
const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
4471
|
+
const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
4477
4472
|
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
4478
4473
|
const id = requestIdleCallback(hydrate, { timeout });
|
|
4479
4474
|
return () => cancelIdleCallback(id);
|
|
@@ -5176,12 +5171,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
5176
5171
|
}
|
|
5177
5172
|
openBlock();
|
|
5178
5173
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
5174
|
+
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
5175
|
+
// key attached in the `createSlots` helper, respect that
|
|
5176
|
+
validSlotContent && validSlotContent.key;
|
|
5179
5177
|
const rendered = createBlock(
|
|
5180
5178
|
Fragment,
|
|
5181
5179
|
{
|
|
5182
|
-
key: (
|
|
5183
|
-
// key attached in the `createSlots` helper, respect that
|
|
5184
|
-
validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
5180
|
+
key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
5185
5181
|
(!validSlotContent && fallback ? "_fb" : "")
|
|
5186
5182
|
},
|
|
5187
5183
|
validSlotContent || (fallback ? fallback() : []),
|
|
@@ -6539,6 +6535,7 @@ function getType(ctor) {
|
|
|
6539
6535
|
function validateProps(rawProps, props, instance) {
|
|
6540
6536
|
const resolvedValues = toRaw(props);
|
|
6541
6537
|
const options = instance.propsOptions[0];
|
|
6538
|
+
const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
|
|
6542
6539
|
for (const key in options) {
|
|
6543
6540
|
let opt = options[key];
|
|
6544
6541
|
if (opt == null) continue;
|
|
@@ -6547,7 +6544,7 @@ function validateProps(rawProps, props, instance) {
|
|
|
6547
6544
|
resolvedValues[key],
|
|
6548
6545
|
opt,
|
|
6549
6546
|
shallowReadonly(resolvedValues) ,
|
|
6550
|
-
!
|
|
6547
|
+
!camelizePropsKey.includes(key)
|
|
6551
6548
|
);
|
|
6552
6549
|
}
|
|
6553
6550
|
}
|
|
@@ -8327,14 +8324,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
|
8327
8324
|
}
|
|
8328
8325
|
const baseWatchOptions = extend({}, options);
|
|
8329
8326
|
baseWatchOptions.onWarn = warn$1;
|
|
8327
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
8330
8328
|
let ssrCleanup;
|
|
8331
8329
|
if (isInSSRComponentSetup) {
|
|
8332
8330
|
if (flush === "sync") {
|
|
8333
8331
|
const ctx = useSSRContext();
|
|
8334
8332
|
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
8335
|
-
} else if (!
|
|
8336
|
-
baseWatchOptions.once = true;
|
|
8337
|
-
} else {
|
|
8333
|
+
} else if (!runsImmediately) {
|
|
8338
8334
|
const watchStopHandle = () => {
|
|
8339
8335
|
};
|
|
8340
8336
|
watchStopHandle.stop = NOOP;
|
|
@@ -8373,7 +8369,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
|
8373
8369
|
}
|
|
8374
8370
|
};
|
|
8375
8371
|
const watchHandle = watch$1(source, cb, baseWatchOptions);
|
|
8376
|
-
if (
|
|
8372
|
+
if (isInSSRComponentSetup) {
|
|
8373
|
+
if (ssrCleanup) {
|
|
8374
|
+
ssrCleanup.push(watchHandle);
|
|
8375
|
+
} else if (runsImmediately) {
|
|
8376
|
+
watchHandle();
|
|
8377
|
+
}
|
|
8378
|
+
}
|
|
8377
8379
|
return watchHandle;
|
|
8378
8380
|
}
|
|
8379
8381
|
function instanceWatch(source, value, options) {
|
|
@@ -8408,19 +8410,19 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
8408
8410
|
warn$1(`useModel() called without active instance.`);
|
|
8409
8411
|
return ref();
|
|
8410
8412
|
}
|
|
8411
|
-
|
|
8413
|
+
const camelizedName = camelize(name);
|
|
8414
|
+
if (!i.propsOptions[0][camelizedName]) {
|
|
8412
8415
|
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
8413
8416
|
return ref();
|
|
8414
8417
|
}
|
|
8415
|
-
const camelizedName = camelize(name);
|
|
8416
8418
|
const hyphenatedName = hyphenate(name);
|
|
8417
|
-
const modifiers = getModelModifiers(props,
|
|
8419
|
+
const modifiers = getModelModifiers(props, camelizedName);
|
|
8418
8420
|
const res = customRef((track, trigger) => {
|
|
8419
8421
|
let localValue;
|
|
8420
8422
|
let prevSetValue = EMPTY_OBJ;
|
|
8421
8423
|
let prevEmittedValue;
|
|
8422
8424
|
watchSyncEffect(() => {
|
|
8423
|
-
const propValue = props[
|
|
8425
|
+
const propValue = props[camelizedName];
|
|
8424
8426
|
if (hasChanged(localValue, propValue)) {
|
|
8425
8427
|
localValue = propValue;
|
|
8426
8428
|
trigger();
|
|
@@ -8719,7 +8721,7 @@ function renderComponentRoot(instance) {
|
|
|
8719
8721
|
}
|
|
8720
8722
|
if (extraAttrs.length) {
|
|
8721
8723
|
warn$1(
|
|
8722
|
-
`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes.`
|
|
8724
|
+
`Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
|
|
8723
8725
|
);
|
|
8724
8726
|
}
|
|
8725
8727
|
if (eventAttrs.length) {
|
|
@@ -9502,9 +9504,9 @@ function closeBlock() {
|
|
|
9502
9504
|
currentBlock = blockStack[blockStack.length - 1] || null;
|
|
9503
9505
|
}
|
|
9504
9506
|
let isBlockTreeEnabled = 1;
|
|
9505
|
-
function setBlockTracking(value) {
|
|
9507
|
+
function setBlockTracking(value, inVOnce = false) {
|
|
9506
9508
|
isBlockTreeEnabled += value;
|
|
9507
|
-
if (value < 0 && currentBlock) {
|
|
9509
|
+
if (value < 0 && currentBlock && inVOnce) {
|
|
9508
9510
|
currentBlock.hasOnce = true;
|
|
9509
9511
|
}
|
|
9510
9512
|
}
|
|
@@ -10047,9 +10049,9 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10047
10049
|
}
|
|
10048
10050
|
const { setup } = Component;
|
|
10049
10051
|
if (setup) {
|
|
10052
|
+
pauseTracking();
|
|
10050
10053
|
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
|
|
10051
10054
|
const reset = setCurrentInstance(instance);
|
|
10052
|
-
pauseTracking();
|
|
10053
10055
|
const setupResult = callWithErrorHandling(
|
|
10054
10056
|
setup,
|
|
10055
10057
|
instance,
|
|
@@ -10059,10 +10061,13 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10059
10061
|
setupContext
|
|
10060
10062
|
]
|
|
10061
10063
|
);
|
|
10064
|
+
const isAsyncSetup = isPromise(setupResult);
|
|
10062
10065
|
resetTracking();
|
|
10063
10066
|
reset();
|
|
10064
|
-
if (
|
|
10065
|
-
|
|
10067
|
+
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
|
|
10068
|
+
markAsyncBoundary(instance);
|
|
10069
|
+
}
|
|
10070
|
+
if (isAsyncSetup) {
|
|
10066
10071
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
10067
10072
|
if (isSSR) {
|
|
10068
10073
|
return setupResult.then((resolvedResult) => {
|
|
@@ -10525,7 +10530,7 @@ function isMemoSame(cached, memo) {
|
|
|
10525
10530
|
return true;
|
|
10526
10531
|
}
|
|
10527
10532
|
|
|
10528
|
-
const version = "3.5.
|
|
10533
|
+
const version = "3.5.13";
|
|
10529
10534
|
const warn = warn$1 ;
|
|
10530
10535
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
10531
10536
|
const devtools = devtools$1 ;
|
|
@@ -10709,7 +10714,8 @@ function resolveTransitionProps(rawProps) {
|
|
|
10709
10714
|
onAppear = onEnter,
|
|
10710
10715
|
onAppearCancelled = onEnterCancelled
|
|
10711
10716
|
} = baseProps;
|
|
10712
|
-
const finishEnter = (el, isAppear, done) => {
|
|
10717
|
+
const finishEnter = (el, isAppear, done, isCancelled) => {
|
|
10718
|
+
el._enterCancelled = isCancelled;
|
|
10713
10719
|
removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
10714
10720
|
removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
|
|
10715
10721
|
done && done();
|
|
@@ -10752,8 +10758,13 @@ function resolveTransitionProps(rawProps) {
|
|
|
10752
10758
|
el._isLeaving = true;
|
|
10753
10759
|
const resolve = () => finishLeave(el, done);
|
|
10754
10760
|
addTransitionClass(el, leaveFromClass);
|
|
10755
|
-
|
|
10756
|
-
|
|
10761
|
+
if (!el._enterCancelled) {
|
|
10762
|
+
forceReflow();
|
|
10763
|
+
addTransitionClass(el, leaveActiveClass);
|
|
10764
|
+
} else {
|
|
10765
|
+
addTransitionClass(el, leaveActiveClass);
|
|
10766
|
+
forceReflow();
|
|
10767
|
+
}
|
|
10757
10768
|
nextFrame(() => {
|
|
10758
10769
|
if (!el._isLeaving) {
|
|
10759
10770
|
return;
|
|
@@ -10767,11 +10778,11 @@ function resolveTransitionProps(rawProps) {
|
|
|
10767
10778
|
callHook(onLeave, [el, resolve]);
|
|
10768
10779
|
},
|
|
10769
10780
|
onEnterCancelled(el) {
|
|
10770
|
-
finishEnter(el, false);
|
|
10781
|
+
finishEnter(el, false, void 0, true);
|
|
10771
10782
|
callHook(onEnterCancelled, [el]);
|
|
10772
10783
|
},
|
|
10773
10784
|
onAppearCancelled(el) {
|
|
10774
|
-
finishEnter(el, true);
|
|
10785
|
+
finishEnter(el, true, void 0, true);
|
|
10775
10786
|
callHook(onAppearCancelled, [el]);
|
|
10776
10787
|
},
|
|
10777
10788
|
onLeaveCancelled(el) {
|
|
@@ -10991,10 +11002,11 @@ function useCssVars(getter) {
|
|
|
10991
11002
|
}
|
|
10992
11003
|
updateTeleports(vars);
|
|
10993
11004
|
};
|
|
10994
|
-
|
|
10995
|
-
|
|
11005
|
+
onBeforeUpdate(() => {
|
|
11006
|
+
queuePostFlushCb(setVars);
|
|
10996
11007
|
});
|
|
10997
11008
|
onMounted(() => {
|
|
11009
|
+
watch(setVars, NOOP, { flush: "post" });
|
|
10998
11010
|
const ob = new MutationObserver(setVars);
|
|
10999
11011
|
ob.observe(instance.subTree.el.parentNode, { childList: true });
|
|
11000
11012
|
onUnmounted(() => ob.disconnect());
|
|
@@ -11158,7 +11170,7 @@ function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBoolean
|
|
|
11158
11170
|
}
|
|
11159
11171
|
}
|
|
11160
11172
|
|
|
11161
|
-
function patchDOMProp(el, key, value, parentComponent) {
|
|
11173
|
+
function patchDOMProp(el, key, value, parentComponent, attrName) {
|
|
11162
11174
|
if (key === "innerHTML" || key === "textContent") {
|
|
11163
11175
|
if (value != null) {
|
|
11164
11176
|
el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
|
|
@@ -11206,7 +11218,7 @@ function patchDOMProp(el, key, value, parentComponent) {
|
|
|
11206
11218
|
);
|
|
11207
11219
|
}
|
|
11208
11220
|
}
|
|
11209
|
-
needRemove && el.removeAttribute(key);
|
|
11221
|
+
needRemove && el.removeAttribute(attrName || key);
|
|
11210
11222
|
}
|
|
11211
11223
|
|
|
11212
11224
|
function addEventListener(el, event, handler, options) {
|
|
@@ -11316,7 +11328,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
|
|
|
11316
11328
|
// #11081 force set props for possible async custom element
|
|
11317
11329
|
el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
|
|
11318
11330
|
) {
|
|
11319
|
-
patchDOMProp(el, camelize(key), nextValue);
|
|
11331
|
+
patchDOMProp(el, camelize(key), nextValue, parentComponent, key);
|
|
11320
11332
|
} else {
|
|
11321
11333
|
if (key === "true-value") {
|
|
11322
11334
|
el._trueValue = nextValue;
|
|
@@ -11601,6 +11613,8 @@ class VueElement extends BaseClass {
|
|
|
11601
11613
|
this._update();
|
|
11602
11614
|
}
|
|
11603
11615
|
if (shouldReflect) {
|
|
11616
|
+
const ob = this._ob;
|
|
11617
|
+
ob && ob.disconnect();
|
|
11604
11618
|
if (val === true) {
|
|
11605
11619
|
this.setAttribute(hyphenate(key), "");
|
|
11606
11620
|
} else if (typeof val === "string" || typeof val === "number") {
|
|
@@ -11608,6 +11622,7 @@ class VueElement extends BaseClass {
|
|
|
11608
11622
|
} else if (!val) {
|
|
11609
11623
|
this.removeAttribute(hyphenate(key));
|
|
11610
11624
|
}
|
|
11625
|
+
ob && ob.observe(this, { attributes: true });
|
|
11611
11626
|
}
|
|
11612
11627
|
}
|
|
11613
11628
|
}
|
|
@@ -12034,7 +12049,7 @@ const vModelCheckbox = {
|
|
|
12034
12049
|
setChecked(el, binding, vnode);
|
|
12035
12050
|
}
|
|
12036
12051
|
};
|
|
12037
|
-
function setChecked(el, { value }, vnode) {
|
|
12052
|
+
function setChecked(el, { value, oldValue }, vnode) {
|
|
12038
12053
|
el._modelValue = value;
|
|
12039
12054
|
let checked;
|
|
12040
12055
|
if (isArray(value)) {
|
|
@@ -12042,6 +12057,7 @@ function setChecked(el, { value }, vnode) {
|
|
|
12042
12057
|
} else if (isSet(value)) {
|
|
12043
12058
|
checked = value.has(vnode.props.value);
|
|
12044
12059
|
} else {
|
|
12060
|
+
if (value === oldValue) return;
|
|
12045
12061
|
checked = looseEqual(value, getCheckboxValue(el, true));
|
|
12046
12062
|
}
|
|
12047
12063
|
if (el.checked !== checked) {
|
|
@@ -12805,12 +12821,13 @@ function createConditionalExpression(test, consequent, alternate, newline = true
|
|
|
12805
12821
|
loc: locStub
|
|
12806
12822
|
};
|
|
12807
12823
|
}
|
|
12808
|
-
function createCacheExpression(index, value, needPauseTracking = false) {
|
|
12824
|
+
function createCacheExpression(index, value, needPauseTracking = false, inVOnce = false) {
|
|
12809
12825
|
return {
|
|
12810
12826
|
type: 20,
|
|
12811
12827
|
index,
|
|
12812
12828
|
value,
|
|
12813
12829
|
needPauseTracking,
|
|
12830
|
+
inVOnce,
|
|
12814
12831
|
needArraySpread: false,
|
|
12815
12832
|
loc: locStub
|
|
12816
12833
|
};
|
|
@@ -14533,6 +14550,9 @@ function getLoc(start, end) {
|
|
|
14533
14550
|
source: end == null ? end : getSlice(start, end)
|
|
14534
14551
|
};
|
|
14535
14552
|
}
|
|
14553
|
+
function cloneLoc(loc) {
|
|
14554
|
+
return getLoc(loc.start.offset, loc.end.offset);
|
|
14555
|
+
}
|
|
14536
14556
|
function setLocEnd(loc, end) {
|
|
14537
14557
|
loc.end = tokenizer.getPos(end);
|
|
14538
14558
|
loc.source = getSlice(loc.start.offset, end);
|
|
@@ -15041,11 +15061,12 @@ function createTransformContext(root, {
|
|
|
15041
15061
|
identifier.hoisted = exp;
|
|
15042
15062
|
return identifier;
|
|
15043
15063
|
},
|
|
15044
|
-
cache(exp, isVNode = false) {
|
|
15064
|
+
cache(exp, isVNode = false, inVOnce = false) {
|
|
15045
15065
|
const cacheExp = createCacheExpression(
|
|
15046
15066
|
context.cached.length,
|
|
15047
15067
|
exp,
|
|
15048
|
-
isVNode
|
|
15068
|
+
isVNode,
|
|
15069
|
+
inVOnce
|
|
15049
15070
|
);
|
|
15050
15071
|
context.cached.push(cacheExp);
|
|
15051
15072
|
return cacheExp;
|
|
@@ -15744,7 +15765,9 @@ function genCacheExpression(node, context) {
|
|
|
15744
15765
|
push(`_cache[${node.index}] || (`);
|
|
15745
15766
|
if (needPauseTracking) {
|
|
15746
15767
|
indent();
|
|
15747
|
-
push(`${helper(SET_BLOCK_TRACKING)}(-1)
|
|
15768
|
+
push(`${helper(SET_BLOCK_TRACKING)}(-1`);
|
|
15769
|
+
if (node.inVOnce) push(`, true`);
|
|
15770
|
+
push(`),`);
|
|
15748
15771
|
newline();
|
|
15749
15772
|
push(`(`);
|
|
15750
15773
|
}
|
|
@@ -15801,12 +15824,14 @@ const transformExpression = (node, context) => {
|
|
|
15801
15824
|
context
|
|
15802
15825
|
);
|
|
15803
15826
|
} else if (node.type === 1) {
|
|
15827
|
+
const memo = findDir(node, "memo");
|
|
15804
15828
|
for (let i = 0; i < node.props.length; i++) {
|
|
15805
15829
|
const dir = node.props[i];
|
|
15806
15830
|
if (dir.type === 7 && dir.name !== "for") {
|
|
15807
15831
|
const exp = dir.exp;
|
|
15808
15832
|
const arg = dir.arg;
|
|
15809
|
-
if (exp && exp.type === 4 && !(dir.name === "on" && arg))
|
|
15833
|
+
if (exp && exp.type === 4 && !(dir.name === "on" && arg) && // key has been processed in transformFor(vMemo + vFor)
|
|
15834
|
+
!(memo && arg && arg.type === 4 && arg.content === "key")) {
|
|
15810
15835
|
dir.exp = processExpression(
|
|
15811
15836
|
exp,
|
|
15812
15837
|
context,
|
|
@@ -15877,7 +15902,7 @@ function processIf(node, dir, context, processCodegen) {
|
|
|
15877
15902
|
const branch = createIfBranch(node, dir);
|
|
15878
15903
|
const ifNode = {
|
|
15879
15904
|
type: 9,
|
|
15880
|
-
loc: node.loc,
|
|
15905
|
+
loc: cloneLoc(node.loc),
|
|
15881
15906
|
branches: [branch]
|
|
15882
15907
|
};
|
|
15883
15908
|
context.replaceNode(ifNode);
|
|
@@ -16134,10 +16159,11 @@ const transformFor = createStructuralDirectiveTransform(
|
|
|
16134
16159
|
const isTemplate = isTemplateNode(node);
|
|
16135
16160
|
const memo = findDir(node, "memo");
|
|
16136
16161
|
const keyProp = findProp(node, `key`, false, true);
|
|
16137
|
-
|
|
16162
|
+
const isDirKey = keyProp && keyProp.type === 7;
|
|
16163
|
+
if (isDirKey && !keyProp.exp) {
|
|
16138
16164
|
transformBindShorthand(keyProp);
|
|
16139
16165
|
}
|
|
16140
|
-
|
|
16166
|
+
let keyExp = keyProp && (keyProp.type === 6 ? keyProp.value ? createSimpleExpression(keyProp.value.content, true) : void 0 : keyProp.exp);
|
|
16141
16167
|
const keyProperty = keyProp && keyExp ? createObjectProperty(`key`, keyExp) : null;
|
|
16142
16168
|
const isStableFragment = forNode.source.type === 4 && forNode.source.constType > 0;
|
|
16143
16169
|
const fragmentFlag = isStableFragment ? 64 : keyProp ? 128 : 256;
|
|
@@ -17334,8 +17360,8 @@ const transformOnce = (node, context) => {
|
|
|
17334
17360
|
if (cur.codegenNode) {
|
|
17335
17361
|
cur.codegenNode = context.cache(
|
|
17336
17362
|
cur.codegenNode,
|
|
17363
|
+
true,
|
|
17337
17364
|
true
|
|
17338
|
-
/* isVNode */
|
|
17339
17365
|
);
|
|
17340
17366
|
}
|
|
17341
17367
|
};
|