VUE懒加载的table前端搜索

      // 前端搜索
      fliterData() {
        const search = this.search
        if (search) {
          this.blist = this.list.filter(item => {
            const children_code = item.children.map(v=>v.code)
            const children_name = item.children.map(v=>v.name)
            return item.code.indexOf(search) > -1 || item.name.indexOf(search) > -1 || children_code.indexOf(search) >-1 || children_name.indexOf(search) >-1
          })
          this.total = this.blist.length
          return this.blist
        }
        this.blist = this.list
        this.total = this.blist.length
        return this.list
      },

  

posted @ 2021-09-07 14:45  醒日是归时  阅读(131)  评论(0编辑  收藏  举报