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