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

update docs

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