js 对象数组删除和查找的方法

deleteItem: function (array,item) {
const index = this.array.findIndex(text => text.name === item.name);
this.array.splice(index, 1);

 

 

亲测vue 中可用

posted @ 2019-04-04 09:51  洛晨随风  阅读(9222)  评论(0编辑  收藏  举报