light-h5-core-lib 2.10.4 → 2.10.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,6 +8,12 @@ exports.SetterGetterBase = void 0;
|
|
|
8
8
|
var SetterGetterBase = /** @class */ (function () {
|
|
9
9
|
function SetterGetterBase() {
|
|
10
10
|
}
|
|
11
|
+
SetterGetterBase.prototype.isNeedCheckChanged = function (publicName) {
|
|
12
|
+
if (!this.ignoreCheckChangedFields || this.ignoreCheckChangedFields.length == 0) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
return !this.ignoreCheckChangedFields.includes(publicName);
|
|
16
|
+
};
|
|
11
17
|
/**
|
|
12
18
|
* 扫描实例属性并自动创建访问器
|
|
13
19
|
*/
|
|
@@ -64,8 +70,9 @@ var SetterGetterBase = /** @class */ (function () {
|
|
|
64
70
|
if (oldValue === value)
|
|
65
71
|
return;
|
|
66
72
|
this[privateName] = value;
|
|
67
|
-
|
|
68
|
-
|
|
73
|
+
if (this.isNeedCheckChanged(publicName)) {
|
|
74
|
+
(_a = this.onPropertyChanged) === null || _a === void 0 ? void 0 : _a.call(this, publicName, value, oldValue);
|
|
75
|
+
}
|
|
69
76
|
},
|
|
70
77
|
enumerable: true,
|
|
71
78
|
configurable: true,
|
package/package.json
CHANGED
package/type/index.d.ts
CHANGED
|
@@ -485,6 +485,11 @@ export declare abstract class SetterGetterBase {
|
|
|
485
485
|
* 不需要添加setter / getter的字段(不需要加_前缀)
|
|
486
486
|
*/
|
|
487
487
|
protected abstract get ignoreFields(): string[];
|
|
488
|
+
/**
|
|
489
|
+
* 不需要监听变化的字段(不需要加_前缀)
|
|
490
|
+
*/
|
|
491
|
+
protected abstract get ignoreCheckChangedFields(): string[];
|
|
492
|
+
private isNeedCheckChanged;
|
|
488
493
|
/**
|
|
489
494
|
* 扫描实例属性并自动创建访问器
|
|
490
495
|
*/
|