1 function gainSearch (payload) {           //payload 为查询关键字
 2   const list = window.gainList            // window.gainList 为一个对象数组 object[]
 3   let arr = []
 4   list.filter((index) => {              // 过滤每一条数据对象
 5     if (index.value1.indexOf(payload) >= 0) {    // 每条数据对象的第一个值进行模糊搜索,多个可采用 || 
 6       return arr.push(index)
 7     }
 8   })
 9   return arr
10 }

 

相关文章:

  • 2022-12-23
  • 2021-04-13
猜你喜欢
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案