diff --git a/zh-cn/application-dev/ui/ts-component-based-builder.md b/zh-cn/application-dev/ui/ts-component-based-builder.md index 1a380688ea6f740b09291bbc41d5353a2819053f..23abd1f50cd482f0f5580d476b2f8ed4a2cc072b 100644 --- a/zh-cn/application-dev/ui/ts-component-based-builder.md +++ b/zh-cn/application-dev/ui/ts-component-based-builder.md @@ -9,12 +9,12 @@ @Entry @Component struct CompA { - size : number = 100; + size1 : number = 100; @Builder SquareText(label: string) { Text(label) - .width(1 * this.size) - .height(1 * this.size) + .width(1 * this.size1) + .height(1 * this.size1) } @Builder RowOfSquareTexts(label1: string, label2: string) { @@ -22,8 +22,8 @@ struct CompA { this.SquareText(label1) this.SquareText(label2) } - .width(2 * this.size) - .height(1 * this.size) + .width(2 * this.size1) + .height(1 * this.size1) } build() { @@ -33,12 +33,12 @@ struct CompA { this.SquareText("B") // or as long as tsc is used } - .width(2 * this.size) - .height(1 * this.size) + .width(2 * this.size1) + .height(1 * this.size1) this.RowOfSquareTexts("C", "D") } - .width(2 * this.size) - .height(2 * this.size) + .width(2 * this.size1) + .height(2 * this.size1) } } ``` diff --git a/zh-cn/application-dev/ui/ts-custom-component-initialization.md b/zh-cn/application-dev/ui/ts-custom-component-initialization.md index 761b9375f01599f66994b6cf459a80b0b55fb262..1433542af3203e3a54f6d883ef099b8f5438f52f 100644 --- a/zh-cn/application-dev/ui/ts-custom-component-initialization.md +++ b/zh-cn/application-dev/ui/ts-custom-component-initialization.md @@ -85,13 +85,13 @@ struct Parent { build() { Column() { Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - CompA({ astate: new ClassA(2), aLink: $parentState }) + CompA({ aState: new ClassA(2), aLink: $parentState }) } Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { CompA({ aLink: $parentState }) } Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) { - CompA({ astate: new ClassA(3), aLink: $parentState }) + CompA({ aState: new ClassA(3), aLink: $parentState }) } } } @@ -99,8 +99,8 @@ struct Parent { @Component struct CompA { - @State aState: any = false - @Link aLink: ClassA + @State aState: any = false + @Link aLink: ClassA build() { Column() { @@ -113,7 +113,7 @@ struct CompA { @Component struct CompB { @Link bLink: ClassA - @Prop bProp: bpplean + @Prop bProp: boolean build() { Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center }) {