Skip to content

[use-antd-resizable-header] dataIndex 重复: create_time,请确保每个列的 [dataIndex] 唯一 Error Component Stack #113

@781574155

Description

@781574155

protable是允许重复的dataIndex的。
比如用于选择时间段的情况。
我有一个创建时间,两个列定义使用相同的dataIndex,一个用在表格中显示。另一个不在表格中显示,用于在高级筛选栏中显示时间的范围。

......
    {
      title: '上传时间',
      dataIndex: 'create_time',
      width: 160,
      valueType: 'dateTime',
      sorter: true,
      hideInSearch: true,
    },
    {
      title: '上传时间',
      dataIndex: 'create_time',
      valueType: 'dateTimeRange',
      hideInTable: true,
      search: {
        transform: (value: any) => {
          return {
            start_time: value[0].replace(' ', 'T'),
            end_time: value[1].replace(' ', 'T'),
          };
        },
      },
      fieldProps: {
        placeholder: ['开始时间', '结束时间'],
      },
    },
......

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions