ES6快速删除数组中的某条数据
//这是vue methods中的一个方法deleteCarEvent(carID){const _this = this;console.log('要删除的carID为:' + carID)deleteCar(carID).then(function(resolve){console.log(resolve)//ES6快速删除某...
·
//这是vue methods中的一个方法
deleteCarEvent(carID){
const _this = this;
console.log('要删除的carID为:' + carID)
deleteCar(carID).then(function(resolve){
console.log(resolve)
//ES6快速删除某条元素的方法
_this.carList.splice( _this.carList.findIndex(item => item.carID === carID), 1)
}, reject => {
Toast('删除失败');
})
},
更多推荐
已为社区贡献16条内容
所有评论(0)