mirror of
https://gitee.com/coder-xiaomo/algorithm-visualization
synced 2025-01-10 19:58:18 +08:00
修复数组为空Bug弹窗
This commit is contained in:
parent
92b7ef448f
commit
fd0794158d
@ -59,13 +59,14 @@ class ArrayVi extends ViBase {
|
|||||||
if (!sortClassInfo['available'])
|
if (!sortClassInfo['available'])
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
let that = this
|
||||||
let ctrlBtn = document.createElement("button")
|
let ctrlBtn = document.createElement("button")
|
||||||
ctrlBtn.innerHTML = sortClassInfo['name']
|
ctrlBtn.innerHTML = sortClassInfo['name']
|
||||||
ctrlBtn.onclick = function () {
|
ctrlBtn.onclick = function () {
|
||||||
// 点击排序算法按钮
|
// 点击排序算法按钮
|
||||||
// if (!updateListDataArray(elementId, { doNotAlert: false }))
|
// if (!that.updateListDataArray(elementId, { doNotAlert: false }))
|
||||||
// return
|
// return
|
||||||
if (!this.listData || this.listData.length == 0) {
|
if (!that.listData || that.listData.length == 0) {
|
||||||
alert("数组为空")
|
alert("数组为空")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -135,6 +136,7 @@ class ArrayVi extends ViBase {
|
|||||||
|
|
||||||
// 绘制数组
|
// 绘制数组
|
||||||
initArray(elementId, listData) {
|
initArray(elementId, listData) {
|
||||||
|
console.log("initArray")
|
||||||
let fragment = shape.getLinkedListFragment(elementId, listData, {
|
let fragment = shape.getLinkedListFragment(elementId, listData, {
|
||||||
x: 100,
|
x: 100,
|
||||||
y: 100,
|
y: 100,
|
||||||
|
Loading…
Reference in New Issue
Block a user