resolve(array){
let newarr = [];
for(let i =0;i < array.length;i++){
(newarr[array[i]['name']] || (newarr[array[i]['name']] = [])).push(array[i]);
}
return newarr;
},
方法2
selectGet(id){
let obj =null;
obj =this.oData.find((item)=>{//这里的oData就是上面遍历的数据源
return item.id === id;//筛选出匹配数据
});
return obj;
},