We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a37a49 commit 3880c51Copy full SHA for 3880c51
packages/core/src/app.ts
@@ -178,6 +178,15 @@ export class App extends BaseService<EventArgs> {
178
this.mainLayer.draw();
179
}
180
181
+ public toJSON(): string {
182
+ return this.mainLayer.toJSON();
183
+ }
184
+
185
+ public fromJSON(json: string): void {
186
+ const layer = Konva.Node.create(json, 'layer');
187
+ this.mainLayer = layer;
188
189
190
public use(plugin: Plugin, ...options: any[]): App {
191
if (!this.installedPlugins.has(plugin.name)) {
192
this.installedPlugins.set(plugin.name, plugin);
0 commit comments