diff --git a/playground/src/pages/Editor.vue b/playground/src/pages/Editor.vue index f5420adc..d2f0565a 100644 --- a/playground/src/pages/Editor.vue +++ b/playground/src/pages/Editor.vue @@ -224,7 +224,18 @@ asyncLoadJs(`${VITE_ENTRY_PATH}/ds-value/index.umd.cjs`).then(() => { datasourceValues.value = (globalThis as any).magicPresetDsValues; }); -save(); +try { + // eslint-disable-next-line no-eval + const magicDSL = eval(`(${localStorage.getItem('magicDSL')})`); + if (!magicDSL) { + save(); + } else { + value.value = magicDSL; + } +} catch (e) { + console.error(e); + save(); +} editorService.usePlugin({ beforeDoAdd: (config: MNode, parent: MContainer) => {