vxe-table 表格过滤某一列的关键字查询,不需要调后端接口

先上效果图:

vxe-table 表格过滤某一列的关键字查询,不需要调后端接口_第1张图片

 方法:

在 vxe-table-column 标签里面用一个卡槽写一个input 标签

            

然后table表格用2个数组存储。
如果  input 框输入有值就走 过滤的方法,否则直接取接口返回的数据。

      if (this.dateTime) {
        this.tableData = this.originData.filter(item => !this.dateTime || item.date.toLowerCase().includes(this.dateTime.toLowerCase()))
      } else {
        this.tableData = this.originData
      }

最后贴上所有代码:





你可能感兴趣的:(vxe-table,vxe-table表格过滤)