ut for @watch do not work issue

Signed-off-by: yfwang6 <wangyongfei6@huawei.com>
Change-Id: I552c9c470010c8d40d7102f6f1f216fce9261d3e
This commit is contained in:
yfwang6
2022-08-29 16:50:27 +08:00
parent 014a29f0e5
commit 74fcfa4573
4 changed files with 7 additions and 7 deletions
@@ -57,8 +57,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);
}
@@ -57,8 +57,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);
}
@@ -57,8 +57,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);
}
@@ -76,9 +76,9 @@ class CompA extends View {
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) {