mirror of
https://github.com/fofolee/uTools-quickcommand.git
synced 2025-06-28 20:02:44 +08:00
添加console.clear
This commit is contained in:
parent
9f9494a600
commit
70a2fb68bb
@ -179,6 +179,9 @@ window.runCodeInSandbox = (code, callback, addVars = {}) => {
|
||||
error: (...stderr) => {
|
||||
callback(null, stderr);
|
||||
},
|
||||
clear: () => {
|
||||
callback({ __clearQuickcommandRunResult: true }, null);
|
||||
},
|
||||
};
|
||||
let sandboxWithAD = Object.assign(addVars, sandbox);
|
||||
sandboxWithAD.quickcommand = window.lodashM.cloneDeep(quickcommand);
|
||||
|
@ -301,9 +301,13 @@ export default {
|
||||
},
|
||||
// 显示运行结果
|
||||
async showRunResult(content, isSuccess) {
|
||||
content = await this.handleContent(content);
|
||||
if (content.__clearQuickcommandRunResult) {
|
||||
this.runResult = [];
|
||||
} else {
|
||||
content = await this.handleContent(content);
|
||||
this.runResult = this.runResult.concat(content);
|
||||
}
|
||||
this.runResultStatus = isSuccess;
|
||||
this.runResult = this.runResult.concat(content);
|
||||
// 刷新组件
|
||||
this.isResultShow
|
||||
? (this.timeStamp = new Date().getTime())
|
||||
|
3
src/plugins/monaco/types/common.d.ts
vendored
3
src/plugins/monaco/types/common.d.ts
vendored
@ -86,7 +86,8 @@ declare function fetch(
|
||||
// console
|
||||
declare var console: {
|
||||
log(message?: any): void,
|
||||
error(message?: any): void
|
||||
error(message?: any): void,
|
||||
clear(): void,
|
||||
}
|
||||
|
||||
declare var setTimeout: (callback: () => void, ms: number) => number;
|
||||
|
Loading…
x
Reference in New Issue
Block a user