!1053 ut适配@watch不回调

Merge pull request !1053 from yfwang6/cherry-pick-1662035553
This commit is contained in:
openharmony_ci
2022-09-05 09:10:07 +00:00
committed by Gitee
4 changed files with 7 additions and 7 deletions
@@ -53,8 +53,8 @@ let envLang = AppStorage.Prop('languageCode');
class MyComponent extends View {
constructor(compilerAssignedUniqueChildId, parent, params) {
super(compilerAssignedUniqueChildId, parent);
this.__varA = AppStorage.GetOrCreate().setAndLink('varA', 2, this);
this.__lang = AppStorage.GetOrCreate().setAndProp('languageCode', 'en', this);
this.__varA = AppStorage.SetAndLink('varA', 2, this, "varA");
this.__lang = AppStorage.SetAndProp('languageCode', 'en', this, "lang");
this.label = 'count';
this.updateWithValueParams(params);
}
@@ -53,8 +53,8 @@ let envLang = AppStorage.Prop('languageCode');
class MyComponent extends View {
constructor(compilerAssignedUniqueChildId, parent, params) {
super(compilerAssignedUniqueChildId, parent);
this.__varA = AppStorage.GetOrCreate().setAndLink('varA', 2, this);
this.__lang = AppStorage.GetOrCreate().setAndProp('languageCode', 'en', this);
this.__varA = AppStorage.SetAndLink('varA', 2, this, "varA");
this.__lang = AppStorage.SetAndProp('languageCode', 'en', this, "lang");
this.label = 'count';
this.updateWithValueParams(params);
}
@@ -53,8 +53,8 @@ let envLang = AppStorage.Prop('languageCode');
class MyComponent extends View {
constructor(compilerAssignedUniqueChildId, parent, params) {
super(compilerAssignedUniqueChildId, parent);
this.__varA = AppStorage.GetOrCreate().setAndLink('varA', 2, this);
this.__lang = AppStorage.GetOrCreate().setAndProp('languageCode', 'en', this);
this.__varA = AppStorage.SetAndLink('varA', 2, this, "varA");
this.__lang = AppStorage.SetAndProp('languageCode', 'en', this, "lang");
this.label = 'count';
this.updateWithValueParams(params);
}
@@ -72,9 +72,9 @@ exports.expectResult =
this.__totalPurchase = new ObservedPropertySimple(0, this, "totalPurchase");
this.__defArray = new ObservedPropertyObject(['c', 'g', 't', 'z'], this, "defArray");
this.__resultTip = new ObservedPropertySimple('', this, "resultTip");
this.updateWithValueParams(params);
this.declareWatch("shopBasket", this.onBasketUpdated);
this.declareWatch("defArray", this.onPutItem);
this.updateWithValueParams(params);
}
updateWithValueParams(params) {
if (params.shopBasket !== undefined) {