From e28bac740213f50f439303be7d46b3ebccc6afc7 Mon Sep 17 00:00:00 2001 From: luoying_ace Date: Sat, 8 Oct 2022 07:35:20 +0000 Subject: [PATCH] update zh-cn/application-dev/reference/arkui-ts/ts-universal-events-show-hide.md. Signed-off-by: luoying_ace --- .../arkui-ts/ts-universal-events-show-hide.md | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-show-hide.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-show-hide.md index c7eed9da29..ec115e51bc 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-show-hide.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-events-show-hide.md @@ -19,30 +19,36 @@ ```ts // xxx.ets -import prompt from '@system.prompt' +import prompt from '@system.prompt'; @Entry @Component struct AppearExample { - @State isShow: boolean = true - private myText: string = 'Text for onAppear' - private changeAppear: string = 'Hide Text' + @State isShow: boolean = true; + @State changeAppear: string = 'Hide Text'; + private myText: string = 'Text for onAppear'; build() { Column() { Button(this.changeAppear) .onClick(() => { - this.isShow = !this.isShow - }).margin(3).backgroundColor(0x2788D9) + this.isShow = !this.isShow; + }).margin(15) if (this.isShow) { - Text(this.myText) + Text(this.myText).fontSize(26).fontWeight(FontWeight.Bold) .onAppear(() => { - this.changeAppear = 'Show Text' - prompt.showToast({ message: 'The text is shown', duration: 2000 }) + this.changeAppear = 'Hide Text'; + prompt.showToast({ + message: 'The text is shown', + duration: 2000 + }) }) .onDisAppear(() => { - this.changeAppear = 'Hide Text' - prompt.showToast({ message: 'The text is hidden', duration: 2000 }) + this.changeAppear = 'Show Text'; + prompt.showToast({ + message: 'The text is hidden', + duration: 2000 + }) }) } }.padding(30).width('100%') -- GitLab