-
-
Save arun12209/5efc95c5c334c4b3b8b3808a0f6c4f09 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 LightningPrompt from 'lightning/prompt'; | |
export default class PromptComponent extends LightningElement { | |
handlePromptClick() { | |
LightningPrompt.open({ | |
message: 'this is the prompt message', | |
//theme defaults to "default" | |
label: 'Please Respond', // this is the header text | |
defaultValue: 'initial input value', //this is optional | |
}).then((result) => { | |
console.log('Result: '+ result); | |
//Prompt has been closed | |
//result is input text if OK clicked | |
//and null if cancel was clicked | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment