From 8f27fe152d4c12de97d51d7e2eefc41e2d7ad9a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=93=E8=BE=89?= <1158222713@qq.com> Date: Tue, 23 Aug 2022 02:13:31 +0000 Subject: [PATCH] =?UTF-8?q?update=20zh-cn/application-dev/ui/ts-other-stat?= =?UTF-8?q?es-consume-provide.md.=20=E9=A6=96=E8=A1=8C=E7=BC=A9=E8=BF=9B?= =?UTF-8?q?=E8=BF=87=E5=A4=9A=20Signed-off-by:=20=E9=82=93=E8=BE=89=20<115?= =?UTF-8?q?8222713@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 邓辉 <1158222713@qq.com> --- .../ui/ts-other-states-consume-provide.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) 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 020490d649..91a13862b2 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; + }) } + } } ``` -- GitLab