blockly > Block > mutationToDom
Block.mutationToDom property
An optional serialization method for defining how to serialize the mutation state to XML. This must be coupled with defining domToMutation
.
Signature:
mutationToDom?: (...p1: any[]) => Element;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["`mutationToDom` is an optional method used to serialize a block's mutation state to XML for persistence."],["This method should be implemented in conjunction with `domToMutation` to handle serialization and deserialization of custom block mutations."]]],["The `Block.mutationToDom` property is an optional method used for serializing a block's mutation state to XML. It defines the process of converting a block's internal state (mutation) into an XML `Element`. This method requires a corresponding `domToMutation` method to be defined. The `mutationToDom` method accepts any number of arguments and returns an XML `Element`.\n"]]