“eb1927d689c7efbd84345da9716a161e61ab3298”上不存在“src/os/bsd/vm/interfaceSupport_bsd.hpp”
未验证 提交 8f27fe15 编写于 作者: 邓辉 提交者: Gitee

update zh-cn/application-dev/ui/ts-other-states-consume-provide.md.

首行缩进过多
Signed-off-by: N邓辉 <1158222713@qq.com>
Signed-off-by: N邓辉 <1158222713@qq.com>
上级 eb2b8d28
...@@ -30,44 +30,44 @@ Provide作为数据的提供方,可以更新其子孙节点的数据,并触 ...@@ -30,44 +30,44 @@ Provide作为数据的提供方,可以更新其子孙节点的数据,并触
@Entry @Entry
@Component @Component
struct CompA { struct CompA {
@Provide("reviewVote") reviewVotes : number = 0; @Provide("reviewVote") reviewVotes : number = 0;
build() { build() {
Column() { Column() {
CompB() CompB()
Button() { Button() {
Text(`${this.reviewVotes}`) Text(`${this.reviewVotes}`)
.fontSize(30) .fontSize(30)
} }
.onClick(() => { .onClick(() => {
this.reviewVotes += 1; this.reviewVotes += 1;
}) })
}
} }
}
} }
@Component @Component
struct CompB { struct CompB {
build() { build() {
Column() { Column() {
CompC() CompC()
}
} }
}
} }
@Component @Component
struct CompC { struct CompC {
@Consume("reviewVote") reviewVotes : number; @Consume("reviewVote") reviewVotes : number;
build() { build() {
Column() { Column() {
Button() { Button() {
Text(`${this.reviewVotes}`) Text(`${this.reviewVotes}`)
.fontSize(30) .fontSize(30)
} }
.onClick(() => { .onClick(() => {
this.reviewVotes += 1; this.reviewVotes += 1;
}) })
}
} }
}
} }
``` ```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册