blockly > Rozszerzenia > zastosuj
Funkcja Extensions.apply()
Stosuje metodę rozszerzenia do bloku. Tę metodę należy wywoływać tylko podczas budowy bloków.
Podpis:
export declare function apply(name: string, block: Block, isMutator: boolean): void;
Parametry
Parametr |
Typ |
Opis |
nazwa |
ciąg znaków |
Nazwa rozszerzenia. |
blok |
Zablokuj |
Blok, do którego ma zostać zastosowane nazwane rozszerzenie. |
isMutator |
wartość logiczna |
Prawda, jeśli to rozszerzenie definiuje mutator. |
Zwroty:
nieważne
Wyjątki
Jeśli nie znaleziono rozszerzenia, {Błąd}.
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2024-09-12 UTC.
[null,null,["Ostatnia aktualizacja: 2024-09-12 UTC."],[[["The `Blockly.Extensions.apply()` function integrates an extension's functionality into a specific block during its creation."],["It requires the extension's name, the target block, and a boolean indicating if the extension is a mutator."],["If the specified extension isn't found, the function throws an error, ensuring proper handling during block construction."]]],["The `Extensions.apply()` function applies a named extension to a specified block during its construction. It takes three parameters: the extension's name, the target block object, and a boolean indicating if the extension is a mutator. The function's purpose is to modify a block with a designated extension. It returns nothing and throws an error if the extension cannot be found.\n"]]