From a3a9dbc55f240ee18c47ba53979fb2ce99224857 Mon Sep 17 00:00:00 2001 From: jiangbo Date: Tue, 5 Jul 2022 18:14:33 +0800 Subject: [PATCH] jiangbo91@huawei.com MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 生命周期不能有private Signed-off-by: jiangbo Change-Id: I0b33b1cb8adefaa332e5cf02aa50888d545c266b --- .../ui/ts-custom-component-lifecycle-callbacks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ed805d83cc..9c1cd67d3d 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 -- GitLab