未验证 提交 06f65977 编写于 作者: 耿文广 提交者: Gitee

update zh-cn/application-dev/quick-start/arkts-state-management-best-practices.md.

Signed-off-by: N耿文广 <gengwenguang@huawei.com>
上级 4638213b
...@@ -130,23 +130,23 @@ class ClassA { ...@@ -130,23 +130,23 @@ class ClassA {
@Component @Component
struct LinkChild { struct LinkChild {
@Link testNum: ClassA; @Link testNum: ClassA;
build() { build() {
Text(`LinkChild testNum ${this.testNum?.c}`) Text(`LinkChild testNum ${this.testNum?.c}`)
} }
} }
@Component @Component
struct PropChild1 { struct PropChild1 {
@Prop testNum: ClassA = new ClassA(1); @Prop testNum: ClassA = new ClassA(1);
build() { build() {
Text(`PropChild1 testNum ${this.testNum?.c}`) Text(`PropChild1 testNum ${this.testNum?.c}`)
.onClick(() => { .onClick(() => {
this.testNum = new ClassA(48); this.testNum = new ClassA(48);
}) })
} }
} }
@Component @Component
...@@ -359,6 +359,7 @@ struct ViewClassC { ...@@ -359,6 +359,7 @@ struct ViewClassC {
this.c.setC(this.c.getC()+1); this.c.setC(this.c.getC()+1);
}) })
} }
}
} }
@Entry @Entry
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册