You need to sign in or sign up before continuing.
未验证 提交 47eeeee3 编写于 作者: O openharmony_ci 提交者: Gitee

!8462 ts-other-states-consume-provide.md示例代码缩进问题

Merge pull request !8462 from 邓辉/feature_1
...@@ -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.
先完成此消息的编辑!
想要评论请 注册