blockly > dialog > setPrompt
dialog.setPrompt()
Legt die Funktion fest, die ausgeführt werden soll, wenn Blockly.dialog.prompt() aufgerufen wird.
Unterschrift:
export declare function setPrompt(promptFunction: (p1: string, p2: string, p3: (p1: string | null) => void) => void): void;
Parameter
Parameter |
Typ |
Beschreibung |
promptFunction |
(p1: Zeichenfolge, p2: Zeichenfolge, p3: (p1: Zeichenfolge | null) => void) => voidm |
Die auszuführende Funktion. |
Gibt zurück:
voidm
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2024-08-22 (UTC).
[null,null,["Zuletzt aktualisiert: 2024-08-22 (UTC)."],[[["Blockly's `dialog.setPrompt()` function assigns a custom function to be executed when the `Blockly.dialog.prompt()` is called, enabling developers to define the behavior of prompt dialogs."],["The assigned `promptFunction` receives three arguments: a title string, a message string, and a callback function to handle the user's input."]]],["The `dialog.setPrompt()` function sets a custom function to be executed when `Blockly.dialog.prompt()` is invoked. This function accepts a `promptFunction` as a parameter, which itself takes three arguments: two strings (`p1`, `p2`) and a callback function (`p3`). The callback function takes a string or null as input. The `setPrompt` function does not return any value. Its key action is to assign the passed custom function.\n"]]