diff --git a/zh-cn/application-dev/ui/ts-custom-component-lifecycle-callbacks.md b/zh-cn/application-dev/ui/ts-custom-component-lifecycle-callbacks.md index ed805d83cc240e92b51c0e180ec60977406ddd8e..9c1cd67d3df25064d8f45d9d63ecdf2b5bf9ae8d 100644 --- a/zh-cn/application-dev/ui/ts-custom-component-lifecycle-callbacks.md +++ b/zh-cn/application-dev/ui/ts-custom-component-lifecycle-callbacks.md @@ -23,7 +23,7 @@ struct CountDownTimerComponent { @State countDownFrom: number = 10 private timerId: number = -1 - private aboutToAppear(): void { + aboutToAppear(): void { this.timerId = setInterval(() => { if (this.countDownFrom <= 1) { clearTimeout(this.timerId) @@ -32,7 +32,7 @@ struct CountDownTimerComponent { }, 1000) // decr counter by 1 every second } - private aboutToDisappear(): void { + aboutToDisappear(): void { if (this.timerId > 0) { clearTimeout(this.timerId) this.timerId = -1