From 371868d2e541833a0ffaa9357c79da7a97ee83be Mon Sep 17 00:00:00 2001 From: "ester.zhou" Date: Fri, 10 Mar 2023 12:01:13 +0800 Subject: [PATCH] Update doc (15364) Signed-off-by: ester.zhou --- .../reference/arkui-ts/ts-methods-custom-dialog-box.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md b/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md index 37bf4de513..2aef524442 100644 --- a/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md +++ b/en/application-dev/reference/arkui-ts/ts-methods-custom-dialog-box.md @@ -108,6 +108,11 @@ struct CustomDialogUser { customStyle: false }) + aboutToDisappear() { + delete this.dialogController, + this.dialogController = undefined + } + onCancel() { console.info('Callback when the first button is clicked') } @@ -124,7 +129,9 @@ struct CustomDialogUser { Column() { Button(this.inputValue) .onClick(() => { - this.dialogController.open() + if (this.dialogController != undefined) { + this.dialogController.open() + } }).backgroundColor(0x317aff) }.width('100%').margin({ top: 5 }) } -- GitLab