Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
blockly > dialog > setPrompt
dialog.setPrompt() işlevi
Blockly.dialog.prompt() çağrıldığında çalıştırılacak işlevi ayarlar.
**Önemli**: Bunu geçersiz kılarken, yerel olmayan istem deneyimlerinin FocusManager'da geçici odağı yönetmeyi gerektirebileceğini unutmayın. Bu, açıkken odağın değiştirilmesini engellediği için doğal pencere istemi için gerekli değildir.
İmza:
export declare function setPrompt(promptFunction?: (message: string, defaultValue: string, callback: (result: string | null) => void) => void): void;
Parametreler
Parametre |
Tür |
Açıklama |
promptFunction |
(message: string, defaultValue: string, callback: (result: string | null) => void) => void |
(İsteğe bağlı) Çalıştırılacağı işlev veya varsayılan uygulamayı geri yüklemek için undefined değeri. |
İadeler:
geçersiz
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-25 UTC.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-25 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"]]