mirror of
https://gitee.com/coder-xiaomo/algorithm-visualization
synced 2025-09-10 06:31:37 +08:00
添加ConsoleClear方法
This commit is contained in:
@@ -88,16 +88,21 @@ initialize()
|
||||
|
||||
// 临时输出
|
||||
function consoleLog(data) {
|
||||
console.log(data)
|
||||
let consoleList = settings.console.consoleList
|
||||
consoleList.push(data)
|
||||
if (consoleList.length > settings.console.maxLine + 1) {
|
||||
consoleList.shift()
|
||||
consoleList[0] = "<small>更早的记录已经被丢掉啦</small>"
|
||||
if (data) {
|
||||
consoleList.push(data)
|
||||
if (consoleList.length > settings.console.maxLine + 1) {
|
||||
consoleList.shift()
|
||||
consoleList[0] = "<small>更早的记录已经被丢掉啦</small>"
|
||||
}
|
||||
}
|
||||
let container = document.getElementById("console-logs")
|
||||
container.innerHTML = consoleList.join("<br>")
|
||||
container.scrollTop = container.scrollHeight
|
||||
let consoleContainer = document.getElementById("console-logs")
|
||||
consoleContainer.innerHTML = consoleList.join("<br>")
|
||||
consoleContainer.scrollTop = container.scrollHeight
|
||||
}
|
||||
function consoleClear() {
|
||||
settings.console.consoleList = []
|
||||
consoleLog()
|
||||
}
|
||||
|
||||
function displayCurrentArray(array) {
|
||||
|
Reference in New Issue
Block a user