show input in console
This commit is contained in:
parent
fbc53fe448
commit
8dc9bfbf7a
@ -35,6 +35,8 @@ export class ConsoleInput {
|
||||
const code = this.inputElem.value;
|
||||
this.inputElem.value = "";
|
||||
|
||||
this.console.addInput(code);
|
||||
|
||||
this.history.push(code);
|
||||
this.historyIndex = this.history.length;
|
||||
|
||||
|
@ -41,7 +41,6 @@ export class PlaygroundConsole {
|
||||
const argString = typeof arg === "function" ? `function ${arg.name}()` : `${arg}`;
|
||||
|
||||
const value = document.createElement("span");
|
||||
value.className = entryType;
|
||||
value.textContent = argString;
|
||||
value.dataset.type = this.#getTypeName(arg);
|
||||
parent.appendChild(value);
|
||||
@ -103,6 +102,10 @@ export class PlaygroundConsole {
|
||||
}
|
||||
}
|
||||
|
||||
addInput() {
|
||||
this.#addEntry("input", "", this.elem, ...arguments);
|
||||
}
|
||||
|
||||
log() {
|
||||
this.#addEntry("log", "", this.elem, ...arguments);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user