未验证 提交 c1e3ab6f 编写于 作者: O openharmony_ci 提交者: Gitee

!7478 attribute not variable

Merge pull request !7478 from Bo Jiang/tiao
......@@ -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)
}
}
```
......
......@@ -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 }) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册