清除缓存

main
JayChou 1 week ago
parent 0a72ffefaf
commit f925bb2ee5
  1. 7
      src/views/program/index.vue

@ -1391,7 +1391,7 @@ const onSave = async () => {
// console.log(graph.toJSON()); // console.log(graph.toJSON());
// return; // return;
clearLocalStorage(); clearLocalStorage(false);
const data = graph.toJSON().cells.map((item: any) => { const data = graph.toJSON().cells.map((item: any) => {
return { return {
node: item, node: item,
@ -1474,10 +1474,13 @@ function loadFromLocalStorage() {
return JSON.parse(localStorage.getItem(SESSION_KEY) as string) || []; return JSON.parse(localStorage.getItem(SESSION_KEY) as string) || [];
} }
function clearLocalStorage() { function clearLocalStorage(falg=true) {
localStorage.removeItem(SESSION_KEY); localStorage.removeItem(SESSION_KEY);
if(falg){
window.location.reload(); window.location.reload();
}
} }
// //
function restoreGraph() { function restoreGraph() {

Loading…
Cancel
Save