@tarojs/runtime 3.7.0-beta.1 → 3.7.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime.cjs.js +8 -5
- package/dist/runtime.esm.js +6 -4
- package/dist/runtime.esm.js.map +1 -1
- package/dist/runtime.h5.js +6 -4
- package/package.json +2 -2
package/dist/runtime.cjs.js
CHANGED
|
@@ -442,7 +442,9 @@ function hydrate(node) {
|
|
|
442
442
|
}
|
|
443
443
|
var nodeName = node.nodeName;
|
|
444
444
|
if (isText(node)) {
|
|
445
|
-
return ( obj = {
|
|
445
|
+
return ( obj = {
|
|
446
|
+
sid: node.sid
|
|
447
|
+
}, obj["v" /* Shortcuts.Text */] = node.nodeValue, obj["nn" /* Shortcuts.NodeName */] = ((_a = componentsAlias[nodeName]) === null || _a === void 0 ? void 0 : _a._num) || '8', obj );
|
|
446
448
|
}
|
|
447
449
|
var data = {};
|
|
448
450
|
data["nn" /* Shortcuts.NodeName */] = nodeName;
|
|
@@ -1050,7 +1052,7 @@ function setStyle(newVal, styleKey) {
|
|
|
1050
1052
|
if (old === newVal)
|
|
1051
1053
|
{ return; }
|
|
1052
1054
|
!this._pending && recordCss(this);
|
|
1053
|
-
if (shared.isNull(newVal) || shared.isUndefined(newVal)) {
|
|
1055
|
+
if (shared.isNull(newVal) || shared.isUndefined(newVal) || newVal === '') {
|
|
1054
1056
|
this._usedStyleProp.delete(styleKey);
|
|
1055
1057
|
delete this._value[styleKey];
|
|
1056
1058
|
}
|
|
@@ -2542,13 +2544,14 @@ TaroEvent.prototype.preventDefault = function preventDefault () {
|
|
|
2542
2544
|
this.defaultPrevented = true;
|
|
2543
2545
|
};
|
|
2544
2546
|
prototypeAccessors$1.target.get = function () {
|
|
2545
|
-
var _a, _b, _c;
|
|
2547
|
+
var _a, _b, _c, _d;
|
|
2546
2548
|
var cacheTarget = this.cacheTarget;
|
|
2547
2549
|
if (!cacheTarget) {
|
|
2548
2550
|
var target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
|
|
2549
|
-
|
|
2551
|
+
// Note:优先判断冒泡场景alipay的targetDataset的sid, 不然冒泡场景target属性吐出不对,其余拿取当前绑定id
|
|
2552
|
+
var element = env.document.getElementById(((_b = target.targetDataset) === null || _b === void 0 ? void 0 : _b.sid) || ((_c = target.dataset) === null || _c === void 0 ? void 0 : _c.sid) || target.id || null);
|
|
2550
2553
|
target.dataset = element !== null ? element.dataset : shared.EMPTY_OBJ;
|
|
2551
|
-
for (var key in (
|
|
2554
|
+
for (var key in (_d = this.mpEvent) === null || _d === void 0 ? void 0 : _d.detail) {
|
|
2552
2555
|
target[key] = this.mpEvent.detail[key];
|
|
2553
2556
|
}
|
|
2554
2557
|
this.cacheTarget = target;
|
package/dist/runtime.esm.js
CHANGED
|
@@ -419,6 +419,7 @@ function hydrate(node) {
|
|
|
419
419
|
const nodeName = node.nodeName;
|
|
420
420
|
if (isText(node)) {
|
|
421
421
|
return {
|
|
422
|
+
sid: node.sid,
|
|
422
423
|
["v" /* Shortcuts.Text */]: node.nodeValue,
|
|
423
424
|
["nn" /* Shortcuts.NodeName */]: ((_a = componentsAlias[nodeName]) === null || _a === void 0 ? void 0 : _a._num) || '8'
|
|
424
425
|
};
|
|
@@ -1043,7 +1044,7 @@ function setStyle(newVal, styleKey) {
|
|
|
1043
1044
|
if (old === newVal)
|
|
1044
1045
|
return;
|
|
1045
1046
|
!this._pending && recordCss(this);
|
|
1046
|
-
if (isNull(newVal) || isUndefined(newVal)) {
|
|
1047
|
+
if (isNull(newVal) || isUndefined(newVal) || newVal === '') {
|
|
1047
1048
|
this._usedStyleProp.delete(styleKey);
|
|
1048
1049
|
delete this._value[styleKey];
|
|
1049
1050
|
}
|
|
@@ -2467,13 +2468,14 @@ class TaroEvent {
|
|
|
2467
2468
|
this.defaultPrevented = true;
|
|
2468
2469
|
}
|
|
2469
2470
|
get target() {
|
|
2470
|
-
var _a, _b, _c;
|
|
2471
|
+
var _a, _b, _c, _d;
|
|
2471
2472
|
const cacheTarget = this.cacheTarget;
|
|
2472
2473
|
if (!cacheTarget) {
|
|
2473
2474
|
const target = Object.create(((_a = this.mpEvent) === null || _a === void 0 ? void 0 : _a.target) || null);
|
|
2474
|
-
|
|
2475
|
+
// Note:优先判断冒泡场景alipay的targetDataset的sid, 不然冒泡场景target属性吐出不对,其余拿取当前绑定id
|
|
2476
|
+
const element = env.document.getElementById(((_b = target.targetDataset) === null || _b === void 0 ? void 0 : _b.sid) || ((_c = target.dataset) === null || _c === void 0 ? void 0 : _c.sid) || target.id || null);
|
|
2475
2477
|
target.dataset = element !== null ? element.dataset : EMPTY_OBJ;
|
|
2476
|
-
for (const key in (
|
|
2478
|
+
for (const key in (_d = this.mpEvent) === null || _d === void 0 ? void 0 : _d.detail) {
|
|
2477
2479
|
target[key] = this.mpEvent.detail[key];
|
|
2478
2480
|
}
|
|
2479
2481
|
this.cacheTarget = target;
|