Browse Source

fix type of column dataIndex (#9298)

pull/9306/head
Leo 7 years ago
committed by Wei Zhu
parent
commit
f8e996ee8e
  1. 2
      components/table/Table.tsx
  2. 2
      components/table/interface.tsx

2
components/table/Table.tsx

@ -696,7 +696,7 @@ export default class Table<T> extends React.Component<TableProps<T>, TableState<
const { prefixCls, dropdownPrefixCls } = this.props;
const { sortOrder } = this.state;
return treeMap(columns, (originColumn, i) => {
let column = { ...originColumn };
let column: ColumnProps<T> = { ...originColumn };
let key = this.getColumnKey(column, i) as string;
let filterDropdown;
let sortButton;

2
components/table/interface.tsx

@ -9,7 +9,7 @@ export type ColumnFilterItem = { text: string; value: string, children?: ColumnF
export interface ColumnProps<T> {
title?: React.ReactNode;
key?: React.Key;
dataIndex?: string;
dataIndex?: keyof T;
render?: (text: any, record: T, index: number) => React.ReactNode;
filters?: ColumnFilterItem[];
onFilter?: (value: any, record: T) => boolean;

Loading…
Cancel
Save