mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-05-01 15:18:47 +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;
|
datasourceValues.value = (globalThis as any).magicPresetDsValues;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
// eslint-disable-next-line no-eval
|
||||||
|
const magicDSL = eval(`(${localStorage.getItem('magicDSL')})`);
|
||||||
|
if (!magicDSL) {
|
||||||
save();
|
save();
|
||||||
|
} else {
|
||||||
|
value.value = magicDSL;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
save();
|
||||||
|
}
|
||||||
|
|
||||||
editorService.usePlugin({
|
editorService.usePlugin({
|
||||||
beforeDoAdd: (config: MNode, parent: MContainer) => {
|
beforeDoAdd: (config: MNode, parent: MContainer) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user