From 19f772e9a06cf6b1df8ded1f85e9bb29e10315fe Mon Sep 17 00:00:00 2001 From: 189******51 Date: Thu, 31 Aug 2023 02:51:38 +0000 Subject: [PATCH] =?UTF-8?q?IssueNo:=20#I7X5WW:[=E6=96=B0=E9=9C=80=E6=B1=82?= =?UTF-8?q?]:=20Rectify=20the=20arkts=20syntax=20of=20qs=20Description:=20?= =?UTF-8?q?Rectify=20the=20arkts=20syntax=20of=20qs=20Sig:=20SIG=5FApplica?= =?UTF-8?q?itonFramework=20Feature=20or=20Bugfix:=20Feature=20Binary=20Sou?= =?UTF-8?q?rce:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 189******51 --- .../quick-start/arkts-builder.md | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/zh-cn/application-dev/quick-start/arkts-builder.md b/zh-cn/application-dev/quick-start/arkts-builder.md index 5eb39033fb..276ee2f8fd 100644 --- a/zh-cn/application-dev/quick-start/arkts-builder.md +++ b/zh-cn/application-dev/quick-start/arkts-builder.md @@ -77,13 +77,22 @@ MyGlobalBuilderFunction() ```ts -ABuilder( $$ : { paramA1: string, paramB1 : string } ); +class ABuilderParam { + paramA1: string = '' + paramB1: string = '' +} + +ABuilder($$ : ABuilderParam); ``` ```ts -@Builder function ABuilder($$: { paramA1: string }) { +class ABuilderParam { + paramA1: string = '' +} + +@Builder function ABuilder($$: ABuilderParam) { Row() { Text(`UseStateVarByReference: ${$$.paramA1} `) } @@ -94,10 +103,10 @@ struct Parent { @State label: string = 'Hello'; build() { Column() { - // 在Parent组件中调用ABuilder的时候,将this.label引用传递给ABuilder + // Pass the this.label reference to the ABuilder component when the ABuilder component is called in the Parent component. ABuilder({ paramA1: this.label }) Button('Click me').onClick(() => { - // 点击“Click me”后,UI从“Hello”刷新为“ArkUI” + // After Click me is clicked, the UI text changes from Hello to ArkUI. this.label = 'ArkUI'; }) } -- GitLab