blockly > Block > domToMutation
Block.domToMutation property
An optional deserialization method for defining how to deserialize the mutation state from XML. This must be coupled with defining mutationToDom
.
Signature:
domToMutation?: (p1: Element) => void;
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."],[[["`domToMutation` is an optional method used to deserialize a block's mutation state from XML."],["This method must be defined in conjunction with `mutationToDom` for proper functionality."],["It takes an XML element as input and updates the block's internal state accordingly."]]],["The `domToMutation` property is an optional method for deserializing a block's mutation state from XML. It requires a corresponding `mutationToDom` definition. This method takes an XML Element as input and is used to configure how the block's state is restored from XML data. Essentially, it's a custom function to load the block's specific data from an XML tag.\n"]]