diff --git a/src/views/program/index.vue b/src/views/program/index.vue index fdfbaaf..c13a319 100644 --- a/src/views/program/index.vue +++ b/src/views/program/index.vue @@ -1391,7 +1391,7 @@ const onSave = async () => { // console.log(graph.toJSON()); // return; - clearLocalStorage(); + clearLocalStorage(false); const data = graph.toJSON().cells.map((item: any) => { return { node: item, @@ -1474,10 +1474,13 @@ function loadFromLocalStorage() { return JSON.parse(localStorage.getItem(SESSION_KEY) as string) || []; } -function clearLocalStorage() { +function clearLocalStorage(falg=true) { localStorage.removeItem(SESSION_KEY); + if(falg){ window.location.reload(); + } + } // 恢复画布状态 function restoreGraph() {