wwf
2025-09-29 1e756186157b50d12eda1fc5812d2beb704ff1d2
初始化
1个文件已添加
23 ■■■■■ 已修改文件
entry/src/main/ets/pages/Index.ets 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
entry/src/main/ets/pages/Index.ets
New file
@@ -0,0 +1,23 @@
@Entry
@Component
struct Index {
  @State message: string = 'Hello World';
  build() {
    RelativeContainer() {
      Text(this.message)
        .id('HelloWorld')
        .fontSize($r('app.float.page_text_font_size'))
        .fontWeight(FontWeight.Bold)
        .alignRules({
          center: { anchor: '__container__', align: VerticalAlign.Center },
          middle: { anchor: '__container__', align: HorizontalAlign.Center }
        })
        .onClick(() => {
          this.message = 'Welcome';
        })
    }
    .height('100%')
    .width('100%')
  }
}