提交 a3a9dbc5 编写于 作者: J jiangbo

jiangbo91@huawei.com

生命周期不能有private
Signed-off-by: Njiangbo <jiangbo91@huawei.com>
Change-Id: I0b33b1cb8adefaa332e5cf02aa50888d545c266b
上级 52dccd8f
...@@ -23,7 +23,7 @@ struct CountDownTimerComponent { ...@@ -23,7 +23,7 @@ struct CountDownTimerComponent {
@State countDownFrom: number = 10 @State countDownFrom: number = 10
private timerId: number = -1 private timerId: number = -1
private aboutToAppear(): void { aboutToAppear(): void {
this.timerId = setInterval(() => { this.timerId = setInterval(() => {
if (this.countDownFrom <= 1) { if (this.countDownFrom <= 1) {
clearTimeout(this.timerId) clearTimeout(this.timerId)
...@@ -32,7 +32,7 @@ struct CountDownTimerComponent { ...@@ -32,7 +32,7 @@ struct CountDownTimerComponent {
}, 1000) // decr counter by 1 every second }, 1000) // decr counter by 1 every second
} }
private aboutToDisappear(): void { aboutToDisappear(): void {
if (this.timerId > 0) { if (this.timerId > 0) {
clearTimeout(this.timerId) clearTimeout(this.timerId)
this.timerId = -1 this.timerId = -1
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册