refactor: 前端异常处理

This commit is contained in:
wangjiahao 2022-04-27 19:37:22 +08:00
parent 7411e5ca47
commit 0847e5e15a

View File

@ -499,19 +499,22 @@ function movePlayer(item, position) {
}
function removeItem(index) {
const vm = this
const item = this.yourList[index]
removeItemFromPositionBox(item)
try {
const vm = this
const item = this.yourList[index]
removeItemFromPositionBox(item)
const belowItems = findBelowItems.call(this, item)
_.forEach(belowItems, function(upItem) {
const canGoUpRows = canItemGoUp(upItem)
if (canGoUpRows > 0) {
moveItemUp.call(vm, upItem, canGoUpRows)
}
})
this.yourList.splice(index, 1, {})
const belowItems = findBelowItems.call(this, item)
_.forEach(belowItems, function(upItem) {
const canGoUpRows = canItemGoUp(upItem)
if (canGoUpRows > 0) {
moveItemUp.call(vm, upItem, canGoUpRows)
}
})
this.yourList.splice(index, 1, {})
} catch (e) {
console.log('removeItem have some ignore error')
}
}
//