提交 8c0bd5a0 编写于 作者: S sienna1128

update docs

Signed-off-by: Nsienna1128 <lixiaoyan45@huawei.com>
上级 dae55cc5
......@@ -29,7 +29,7 @@ TextClock容器组件的控制器,可以将该控制器绑定到TextClock组
### 导入对象
```ts
controller: TextClockController = new TextClockController()
controller: TextClockController = new TextClockController();
```
### start
......@@ -68,9 +68,9 @@ stop()
@Entry
@Component
struct Second {
@State accumulateTime: number = 0
@State accumulateTime: number = 0;
// 导入对象
controller: TextClockController = new TextClockController()
controller: TextClockController = new TextClockController();
build() {
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text('Current milliseconds is ' + this.accumulateTime)
......@@ -79,7 +79,7 @@ struct Second {
TextClock({ timeZoneOffset: -8, controller: this.controller })
.format('hms')
.onDateChange((value: number) => {
this.accumulateTime = value
this.accumulateTime = value;
})
.margin(20)
.fontSize(30)
......@@ -87,12 +87,12 @@ struct Second {
.margin({ bottom: 10 })
.onClick(() => {
// 启动文本时钟
this.controller.start()
this.controller.start();
})
Button("stop TextClock")
.onClick(() => {
// 停止文本时钟
this.controller.stop()
this.controller.stop();
})
}
.width('100%')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册