diff --git a/zh-cn/application-dev/ui/ts-other-states-consume-provide.md b/zh-cn/application-dev/ui/ts-other-states-consume-provide.md index 020490d649adba95d3dfe17fc0693d9c356e17e5..91a13862b2db308743db5117cce79739fefd7861 100644 --- a/zh-cn/application-dev/ui/ts-other-states-consume-provide.md +++ b/zh-cn/application-dev/ui/ts-other-states-consume-provide.md @@ -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; + }) } + } } ```