模糊查询json数组

var PatientList=[

{"value":1242,"name":"小乔"},

{"value":1634,"name":"露娜"}

{"value":1521,"name":"李白"},

{"value":1765,"name":"娜可露露"},

{"value":1358,"name":"貂蝉"},

]

 

_queryName(name){
  var NameList=[];
  PatientList.map((item,index)=>{
  if(item.name.match(name)){
  this.NameList.push(item);
  }
});
// console.log(name,NameList)
}

posted @ 2020-09-28 16:10  管的宽  阅读(382)  评论(0编辑  收藏  举报