Vue中针对某些列进行搜索(对列转换大小写)

  getSearchInfo() {
   let search = this.search
   if (search) {
    this.currpage = 1
    this.currentPage = 1
    return this.tableData.filter(data => {
     return Object.keys(data).some(key => {
      if (['name','value'].includes(key)) {
       return data[key].toLowerCase().indexOf(search.toLowerCase()) > -1
      }
     })
    })
   }
   return this.tableData
  },

 

posted @ 2021-07-27 09:55  yw3692582  阅读(162)  评论(0编辑  收藏  举报