子输入框输入后清楚上一次的事件

This commit is contained in:
fofolee 2022-04-23 09:58:46 +08:00
parent e260d14a36
commit 0be0c8dd88

View File

@ -166,6 +166,7 @@ export default {
this.history.push(this.subInputValue); this.history.push(this.subInputValue);
this.historyIdx = this.history.length; this.historyIdx = this.history.length;
utools.setSubInputValue(""); utools.setSubInputValue("");
this.clear();
this.fire(command); this.fire(command);
}; };
// //
@ -239,19 +240,22 @@ export default {
}, },
stopRun() { stopRun() {
this.runResult = ""; this.runResult = "";
if (!!this.child) {
quickcommand.kill(this.child.pid);
}
quickcommand.closeWaitBtn?.();
quickcommand.closeWaitBtn = () => {};
if (!!this.subInputListener) { if (!!this.subInputListener) {
this.subInputValue = ""; this.subInputValue = "";
utools.removeSubInput(); utools.removeSubInput();
document.removeEventListener("keydown", this.subInputListener, true); document.removeEventListener("keydown", this.subInputListener, true);
} }
this.clear();
},
clear() {
if (!!this.quickcommandListener) { if (!!this.quickcommandListener) {
document.removeEventListener("keydown", this.quickcommandListener); document.removeEventListener("keydown", this.quickcommandListener);
} }
if (!!this.child) {
quickcommand.kill(this.child.pid);
}
quickcommand.closeWaitBtn?.();
quickcommand.closeWaitBtn = () => {};
}, },
}, },
unmounted() { unmounted() {