未验证 提交 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作为数据的提供方,可以更新其子孙节点的数据,并触
@Entry
@Component
struct CompA {
@Provide("reviewVote") reviewVotes : number = 0;
@Provide("reviewVote") reviewVotes : number = 0;
build() {
Column() {
CompB()
Button() {
Text(`${this.reviewVotes}`)
.fontSize(30)
}
.onClick(() => {
this.reviewVotes += 1;
})
}
build() {
Column() {
CompB()
Button() {
Text(`${this.reviewVotes}`)
.fontSize(30)
}
.onClick(() => {
this.reviewVotes += 1;
})
}
}
}
@Component
struct CompB {
build() {
Column() {
CompC()
}
build() {
Column() {
CompC()
}
}
}
@Component
struct CompC {
@Consume("reviewVote") reviewVotes : number;
build() {
Column() {
Button() {
Text(`${this.reviewVotes}`)
.fontSize(30)
}
.onClick(() => {
this.reviewVotes += 1;
})
}
@Consume("reviewVote") reviewVotes : number;
build() {
Column() {
Button() {
Text(`${this.reviewVotes}`)
.fontSize(30)
}
.onClick(() => {
this.reviewVotes += 1;
})
}
}
}
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册