版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_34664239/article/details/88949506
//这是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('删除失败');
})
},