20 行
460 B
Plaintext
20 行
460 B
Plaintext
|
|
@Entry
|
||
|
|
@Component
|
||
|
|
struct Index {
|
||
|
|
@State message: string = 'Hello World';
|
||
|
|
|
||
|
|
build() {
|
||
|
|
RelativeContainer() {
|
||
|
|
Text(this.message)
|
||
|
|
.id('HelloWorld')
|
||
|
|
.fontSize(50)
|
||
|
|
.fontWeight(FontWeight.Bold)
|
||
|
|
.alignRules({
|
||
|
|
center: { anchor: '__container__', align: VerticalAlign.Center },
|
||
|
|
middle: { anchor: '__container__', align: HorizontalAlign.Center }
|
||
|
|
})
|
||
|
|
}
|
||
|
|
.height('100%')
|
||
|
|
.width('100%')
|
||
|
|
}
|
||
|
|
}
|