-
-
Save arun12209/d61795cc318df62eb11f89e75a291c68 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { LightningElement } from 'lwc'; | |
import LightningAlert from 'lightning/alert'; //this module needs to import. | |
export default class AlertComponent extends LightningElement { | |
async handleAlertClick() { | |
await LightningAlert.open({ | |
message: 'This is the alert message from LWC', | |
theme: 'error', // a red theme intended for error states | |
label: 'Error!', // this is the header text | |
}); | |
//Alert has been closed | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment