blockly > serialization > workspaces > load
Fonction serialization.workspaces.load()
Charge la variable représentée par l'état donné dans l'espace de travail donné.
Signature :
export declare function load(state: {
[key: string]: any;
}, workspace: Workspace, { recordUndo }?: {
recordUndo?: boolean;
}): void;
Paramètres
Paramètre |
Type |
Description |
state |
{ [key: string]: any; } |
État de l'espace de travail à désérialiser dans l'espace de travail. |
espace de travail |
Workspace |
Espace de travail auquel ajouter le nouvel état. |
{ recordUndo } |
{ recordUndo?: boolean; } |
(Facultatif) |
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 2024/11/04 (UTC).
[null,null,["Dernière mise à jour le 2024/11/04 (UTC)."],[[["The `serialization.workspaces.load()` function imports a workspace's state, defined by a JSON object, into a specified Blockly workspace."],["This function takes the workspace state, target workspace, and an optional flag for undo recording as parameters."],["It deserializes the provided state data and integrates it into the designated workspace without returning any specific value."]]],["The `serialization.workspaces.load()` function loads a workspace's state into a designated workspace. It takes a `state` object, containing the workspace's data, and a `workspace` object, where the data will be loaded. Optionally, it accepts a `recordUndo` boolean to track changes. The function modifies the given `workspace` by deserializing the provided `state` into it. It returns nothing.\n"]]