咸鱼

咸鱼是以盐腌渍后,晒干的鱼

0%

声明式UI:ArkTs简单语法总结

此文档为了对比各个声明式UI编程语法,避免混淆。

ArkTs 是 TypeScript 的超集。

这是官网的一个 Hello World

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
@Entry
@Component
struct Hello{

@State myText: string = 'World';

build(){

Column(){
Text(`Hello ${this.myText}`)
.fontSize(50)
Divider()
Button('click me')
.onClick(()=>{
this.myText - "ArkUI"
})
.height(50)
.width(100)
.margin({ top: 20})
}
}
}

TODO