Notification box in the lower right corner of the window

showErrorMessage

Show an error message in the lower right corner of the window.

Parameters

Name Type Description
message String The message to show, support html tags
buttons Array<String> Button group in notification box

Returns

Type Description
Promise<String> A promise that resolves to the selected item.

Example

let resultPromise = hx.window.showErrorMessage('Do you want to delete the file?',['Yes','No']);
resultPromise.then((result)=>{
    if(result == 'Yes'){
        console.log("Your choice: Yes");
    }else if(result === 'No'){
        console.log("Your choice: No");
    }
});

showInformationMessage

Show an information message in the lower right corner of the window.

Parameters

Name Type Description
message String The message to show, support html tags
buttons Array<String> Button group in notification box

Returns

Type Description
Promise<String> A promise that resolves to the selected item.

Example

hx.window.showInformationMessage('Learn More <a href="http://www.dcloud.io">Reference Documents</a>');

showWarningMessage

Show a warning message in the lower right corner of the window.

Parameters

Name Type Description
message String The message to show, support html tags
buttons Array<String> Button group in notification box

Returns

Type Description
Promise<String> A promise that resolves to the selected item.

Example

let resultPromise = hx.window.showWarningMessage('Do you want to delete the file?',['Yes','No']);
resultPromise.then((result)=>{
    if(result == 'Yes'){
        console.log("Your choice: Yes");
    }else if(result === 'No'){
        console.log("Your choice: No");
    }
});

Found mistake? Want to participate in editing? Edit this page on GitHub

HBuilderX plug-in development document, not translated into English, welcome to contribute. Translate this document on github