mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-08 14:34:13 +08:00
删除命令时也清空对应历史记录
This commit is contained in:
parent
1cb2dee7df
commit
5e654a8964
@ -442,6 +442,7 @@ export default {
|
|||||||
utools.copyText(JSON.stringify(this.allQuickCommands[code], null, 4));
|
utools.copyText(JSON.stringify(this.allQuickCommands[code], null, 4));
|
||||||
delete this.allQuickCommands[code];
|
delete this.allQuickCommands[code];
|
||||||
this.$root.utools.delDB("qc_" + code);
|
this.$root.utools.delDB("qc_" + code);
|
||||||
|
this.removeCommandFromHistory(code);
|
||||||
this.disableCommand(code);
|
this.disableCommand(code);
|
||||||
this.getAllQuickCommandTags();
|
this.getAllQuickCommandTags();
|
||||||
if (!this.allQuickCommandTags.includes(this.currentTag))
|
if (!this.allQuickCommandTags.includes(this.currentTag))
|
||||||
@ -449,9 +450,18 @@ export default {
|
|||||||
quickcommand.showMessageBox(
|
quickcommand.showMessageBox(
|
||||||
"删除成功,为防止误操作,已将删除的命令复制到剪贴板",
|
"删除成功,为防止误操作,已将删除的命令复制到剪贴板",
|
||||||
"success",
|
"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) {
|
editCommand(command) {
|
||||||
// 即可传入 code,也可直接传入 command
|
// 即可传入 code,也可直接传入 command
|
||||||
|
Loading…
x
Reference in New Issue
Block a user