mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-12-15 23:54:35 +08:00
ctrl+space 快速 console.log
This commit is contained in:
@@ -368,8 +368,9 @@ export default {
|
||||
});
|
||||
},
|
||||
// 运行
|
||||
runCurrentCommand() {
|
||||
runCurrentCommand(cmd) {
|
||||
let command = _.cloneDeep(this.quickcommandInfo);
|
||||
if (cmd) command.cmd = cmd;
|
||||
command.output =
|
||||
this.$refs.sidebar?.currentCommand.output ||
|
||||
(command.program === "html" ? "html" : "text");
|
||||
@@ -382,7 +383,7 @@ export default {
|
||||
command.cursorPosition = this.$refs.editor.getCursorPosition();
|
||||
this.$root.utools.putDB(command, "cfg_codeHistory");
|
||||
},
|
||||
monacoKeyStroke(event) {
|
||||
monacoKeyStroke(event, data) {
|
||||
switch (event) {
|
||||
case "run":
|
||||
this.runCurrentCommand();
|
||||
@@ -390,6 +391,10 @@ export default {
|
||||
case "save":
|
||||
this.saveCurrentCommand();
|
||||
break;
|
||||
case "log":
|
||||
if (this.quickcommandInfo.program !== "quickcommand") return;
|
||||
this.runCurrentCommand(`console.log(${data})`);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user