Skip to main content

Function: askChoice()

askChoice(parent, __namedParameters): Promise<string>

Defined in: src/ui/ask/index.ts:107

Ask the user to choose one of several choices in a dialog shown in parent, resolving its value, or CANCEL_CHOICE for the cancel button, Escape or a press outside it.

Parameters​

parent​

Node

__namedParameters​

AskChoiceOptions

Returns​

Promise<string>

Example​

const choice = await askChoice(this.renderRoot, { heading: "Save changes?", cancel: "Cancel",
choices: [{ value: "save", label: "Save" }, { value: "discard", label: "Don't save", cancelling: true }] });