diff --git a/ArkUI/entry/src/main/ets/pages/SetDifferentAttributes.ets b/ArkUI/entry/src/main/ets/pages/SetDifferentAttributes.ets index ca4cfc1a8b9ebbdf7bb721a00867ff95800aef1b..2583e63f74ec921782c97b7df7f35044743518e1 100644 --- a/ArkUI/entry/src/main/ets/pages/SetDifferentAttributes.ets +++ b/ArkUI/entry/src/main/ets/pages/SetDifferentAttributes.ets @@ -25,6 +25,7 @@ struct TestHeightPage { @State myHeight1: number = 30; @State myHeight2: number = 60; @State flag: Boolean = false + build() { Column() { Text(this.message) @@ -35,17 +36,11 @@ struct TestHeightPage { .backgroundColor(Color.Orange) Button('Modify Text attribute height').onClick(() => { - //1.if/else - if (this.flag) { - this.flag = false; - } else { - this.flag = true; - } - //2.取反 this.flag = !this.flag; }).margin({ top: 12 }) } .height('100%') } } + // [End set_different_attributes] \ No newline at end of file