Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
blockly > Bloquer > supprimer
Méthode Block.dispose()
Mettez ce bloc au rebut.
Signature :
dispose(healStack?: boolean): void;
Paramètres
Paramètre |
Type |
Description |
healStack |
booléen |
(Facultatif) Si la valeur est "true", essayez de combler les lacunes en associant l'instruction suivante à l'instruction précédente. Sinon, supprimez tous les enfants de ce bloc. |
Renvoie :
vide
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/25 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/25 (UTC)."],[[["The `dispose()` method permanently removes a block from the workspace."],["It optionally takes a boolean argument, `healStack`, to determine whether to connect the surrounding blocks or dispose of all the block's children."],["By default, `healStack` is false, resulting in the removal of the block and all its nested components."],["When `healStack` is true, it attempts to maintain workspace continuity by connecting the preceding and succeeding blocks."]]],["The `Block.dispose()` method removes a block. It accepts an optional boolean parameter, `healStack`. If `healStack` is true, the method attempts to connect the next statement to the previous one, filling any gaps. If `healStack` is false or omitted, all child blocks of the disposed block are also removed. The method does not return any value.\n"]]