mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
feat(playground): 缓存上次保存dsl
This commit is contained in:
parent
edfe5c6973
commit
47b19ae7fa
@ -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) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user