删除掉了一个元素后,数组的索引发生的变化,造成了程序的异常解决方法

sureRuleDelete () {
    this.deleteRuleDialog = false
  for ( let i=this.tableData.length; i>=0; i--){
    this.selectionData.forEach( item => {
      if (item.fieid == i+1) {
        this.tableData.splice(i,1)
      }
    })
  }
 }
原文地址:https://www.cnblogs.com/yiyiyurou/p/9774772.html