From 5e654a8964d3dc1857c1e331d0ef08dab4c3f709 Mon Sep 17 00:00:00 2001 From: fofolee Date: Fri, 20 Dec 2024 16:19:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=91=BD=E4=BB=A4=E6=97=B6?= =?UTF-8?q?=E4=B9=9F=E6=B8=85=E7=A9=BA=E5=AF=B9=E5=BA=94=E5=8E=86=E5=8F=B2?= =?UTF-8?q?=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ConfigurationPage.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pages/ConfigurationPage.vue b/src/pages/ConfigurationPage.vue index ea62360..8a17e9b 100644 --- a/src/pages/ConfigurationPage.vue +++ b/src/pages/ConfigurationPage.vue @@ -442,6 +442,7 @@ export default { utools.copyText(JSON.stringify(this.allQuickCommands[code], null, 4)); delete this.allQuickCommands[code]; this.$root.utools.delDB("qc_" + code); + this.removeCommandFromHistory(code); this.disableCommand(code); this.getAllQuickCommandTags(); if (!this.allQuickCommandTags.includes(this.currentTag)) @@ -449,9 +450,18 @@ export default { quickcommand.showMessageBox( "删除成功,为防止误操作,已将删除的命令复制到剪贴板", "success", - 1000 + 1000, + "bottom-right" ); }, + removeCommandFromHistory(code) { + for (let i = 0; i < localStorage.length; i++) { + const key = localStorage.key(i); + if (key.startsWith("editor_history_" + code)) { + localStorage.removeItem(key); + } + } + }, // 编辑命令 editCommand(command) { // 即可传入 code,也可直接传入 command