【问题标题】:change the sorter icon in ant design table component更改 ant 设计表组件中的排序器图标
【发布时间】:2021-06-02 05:40:03
【问题描述】:

我想在 ant design table 组件中更改排序器上下图标,但我在 ant design 文档中找不到任何属性或道具。 我找到了通过在表格列上使用 filterIcon 道具来更改过滤器图标的方法。

const columns = [
  {
    title: 'Chinese Score',
    dataIndex: 'chinese',
    sorter: {
      compare: (a, b) => a.chinese - b.chinese,
      multiple: 3,
    },
  },

【问题讨论】:

    标签: javascript reactjs antd


    【解决方案1】:

    我知道是否有人在寻找答案:

    const columns=[{
          title: (
            <div style={{ display: "flex", alignItems: "center" }}>
              Publish Books <SortIcon style={{ marginLeft: "8px" }} />
            </div>
          ),
          dataIndex: "publishedBooks",
          sorter: {
            compare: (a, b) => a.publishedBooks - b.publishedBooks,
            multiple: 4,
          },
        },
    ]
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-28
      • 2019-03-03
      • 2020-10-02
      • 1970-01-01
      • 2020-06-19
      • 1970-01-01
      • 2020-03-19
      • 2019-06-01
      相关资源
      最近更新 更多