From 0585af33801619a4726cd89b6f34d6d6d8cc875e Mon Sep 17 00:00:00 2001 From: chesteryue <chester.yuxi@gmail.com> Date: Wed, 11 Aug 2021 23:46:39 +0800 Subject: [PATCH] [A] clear local storage button --- index.html | 5 ++++- preview.js | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index fd0eaae..f3afe3a 100644 --- a/index.html +++ b/index.html @@ -51,13 +51,16 @@ <div class="item"> <v-btn id="btn-recompile" small height="25"><span style="color: #aaa;">Recompile</span></v-btn> </div> + <div class="item"> + <v-btn @click="clearLocalStorage" small height="25"><span style="color: #aaa;">Clear Local Storage</span></v-btn> + </div> <v-icon @click="openCocosDocs" small>mdi-cloud-search</v-icon> <v-icon @click="openCocosForum" small>mdi-forum</v-icon> <v-icon @click="openCacheDialog" small>mdi-table</v-icon> <v-icon @click="openGithub" small>mdi-home</v-icon> </div> </v-app-bar> - + <div v-if="!isShowTop"> <div id="recompiling"><span>Recompiling...</span></div> <div class="toolbar"> diff --git a/preview.js b/preview.js index 418b993..1bb45ea 100644 --- a/preview.js +++ b/preview.js @@ -161,6 +161,11 @@ const app = new Vue({ }, openCocosDocs() { window.open('https://docs.cocos.com/'); + }, + clearLocalStorage() { + console.warn("[ccc-devtools] clearLocalStorage"); + localStorage.clear(); + window.location.reload(); } } });