Skip to main content

showDialog

Description

Open a dialog to display some information to the user

Parameters

ParamData typeRequiredDescription
titlestringNoTitle of the dialog
descriptionstringNoContent of the dialog
buttonsstring[]No (Default: ["OK"])Array of title of the buttons
dangerIndexnumberNo"Close" button position, first button position is 0
onClick(index: number) => anyNoThe action is triggered when the user press the button

Return Value

N/A

Error Code

N/A

Sample Code and Sample Return Data

Sample Request:

window.zlpSdk.UI
.showDialog({ title: "Tiêu đề", description: "Đây là nội dung" })
.then((response) => console.log(response))
.catch((error) => console.error(error.errorCode));

Sample Response:

{ data: {}, status: "success" }