helloworld实例
// An example of displaying Hello World. After you click the button, Hello UI is displayed. @Entry @Component struct Hello { @State myText: string = 'World' build() { Column() { Text('Hello') .fontSize(30) Text(this.myText) .fontSize(32) Divider() Button() { Text('Click me') .fontColor(Color.Red) }.onClick(() => { this.myText = 'UI' }) .width(500) .height(200) } } }