table 自定义表头、表头事件


[vue3代码]写在生成的[表.vue]文件中,[vue2代码]写在[表.jsx]文件methods方法中;二选一实现
vue3 代码
const conInited = () => {
  columns.forEach((x) => {
    if (x.field == "字段") {
      //自定义表头
      x.renderHeader = (h, { row, column, index }) => {
        return (
          <div
            style="color:red"
            onClick={() => {
              proxy.$message.success("点击了表头");
            }}>
            {column.title}
            <span class="el-icon-search" style="margin-left:4px"></span>
          </div>
        );
      };
    }
  });
  //明细表格开启表头过滤
  detail.Columns.forEach((x) => {
    //操作同上
  });
};

隐藏高级查询按钮