封鎖 >Xml >blockToDom
Xml.blockToDom() 函式
以 XML 編碼區塊子樹狀結構。
Signature:
export declare function blockToDom(block: Block, opt_noId?: boolean): Element | DocumentFragment;
參數
參數 |
類型 |
說明 |
封鎖 |
封鎖 |
要編碼的根區塊。 |
opt_noId |
布林值 |
(選用) 如果編碼器應略過區塊 ID,則值為 True。 |
傳回:
元素 |DocumentFragment
如果區塊是插入標記,則由 XML 元素或空白文件片段的樹狀結構。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-08-28 (世界標準時間)。
[null,null,["上次更新時間:2024-08-28 (世界標準時間)。"],[[["`blockToDom` function encodes a Blockly block and its children into an XML structure, which can be used to save and load block structures."],["It accepts a `Block` object as input and an optional boolean to omit the block's ID during encoding."],["The function returns an XML `Element` or a `DocumentFragment` representing the encoded block structure, or an empty `DocumentFragment` for insertion markers."]]],[]]