未验证 提交 bc92af43 编写于 作者: O openharmony_ci 提交者: Gitee

!6354 fix 生命周期函数不能写private

Merge pull request !6354 from Bo Jiang/dev
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册