blockly > Uzantılar > buildTooltipWithFieldText
Extensions.buildTooltipWithFieldText() işlevi
Dinamik ipucu yükleyecek bir uzantı işlevi oluşturur. İpucu mesajı "%1" dizesini içermelidir ve bu dize, adlandırılmış alanın metniyle değiştirilir.
İmza:
export declare function buildTooltipWithFieldText(msgTemplate: string, fieldName: string): (this: Block) => void;
Parametreler
Parametre |
Tür |
Açıklama |
msgTemplate |
dize |
%1 yer tutucusu içeren ileti metninin şablon formu. |
fieldName |
dize |
Yeni metnin bulunduğu alan. |
Şunu döndürür:
(bu: Engelle) => geçersiz
Uzantı işlevi.
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: 2024-09-12 UTC.
[null,null,["Son güncelleme tarihi: 2024-09-12 UTC."],[[["`Extensions.buildTooltipWithFieldText()` creates a dynamic tooltip for blocks, updating the tooltip text based on a specified field's value."],["The tooltip message is constructed using a template with '%1' as a placeholder, which is replaced with the content of the designated field."],["It accepts two parameters: `msgTemplate`, a string containing the tooltip template, and `fieldName`, identifying the field providing the replacement text."],["This function returns an extension function that can be applied to blocks to enable dynamic tooltips."]]],[]]