add clear storage

This commit is contained in:
zizifn
2022-06-14 23:43:29 +08:00
committed by zizifn
parent 8e5a651310
commit cac4da3df4
2 changed files with 6 additions and 0 deletions

View File

@@ -4,6 +4,10 @@ import { testStr, restartAPP } from './manage-utils.js'
const main = document.querySelector("#main");
const template = document.querySelector('#app-list');
const save2Local = document.querySelector("#save2Local")
const clearlocalstorage = document.querySelector("#clearlocalstorage");
clearlocalstorage.addEventListener('click', ()=>{
localStorage.clear();
})
// const accounts = [];
const accountsStr = localStorage.getItem("accounts");
const accounts = new Set(JSON.parse(accountsStr) || []);