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

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

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

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

Notification box in the lower right corner of the window - 图1

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

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