mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-04 04:58:55 +08:00
commit
c2782b9581
@ -31,11 +31,11 @@ export type ListSize = 'small' | 'default' | 'large';
|
|||||||
|
|
||||||
export type ListItemLayout = 'horizontal' | 'vertical';
|
export type ListItemLayout = 'horizontal' | 'vertical';
|
||||||
|
|
||||||
export interface ListProps {
|
export interface ListProps<T> {
|
||||||
bordered?: boolean;
|
bordered?: boolean;
|
||||||
className?: string;
|
className?: string;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
dataSource: any;
|
dataSource: T[];
|
||||||
extra?: React.ReactNode;
|
extra?: React.ReactNode;
|
||||||
grid?: ListGridType;
|
grid?: ListGridType;
|
||||||
id?: string;
|
id?: string;
|
||||||
@ -45,7 +45,7 @@ export interface ListProps {
|
|||||||
pagination?: PaginationConfig | false;
|
pagination?: PaginationConfig | false;
|
||||||
prefixCls?: string;
|
prefixCls?: string;
|
||||||
rowKey?: any;
|
rowKey?: any;
|
||||||
renderItem: any;
|
renderItem: (item: T, index: number) => React.ReactNode;
|
||||||
size?: ListSize;
|
size?: ListSize;
|
||||||
split?: boolean;
|
split?: boolean;
|
||||||
header?: React.ReactNode;
|
header?: React.ReactNode;
|
||||||
@ -57,7 +57,7 @@ export interface ListLocale {
|
|||||||
emptyText: React.ReactNode | (() => React.ReactNode);
|
emptyText: React.ReactNode | (() => React.ReactNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class List extends React.Component<ListProps> {
|
export default class List<T> extends React.Component<ListProps<T>> {
|
||||||
static Item: typeof Item = Item;
|
static Item: typeof Item = Item;
|
||||||
|
|
||||||
static childContextTypes = {
|
static childContextTypes = {
|
||||||
@ -70,7 +70,7 @@ export default class List extends React.Component<ListProps> {
|
|||||||
bordered: false,
|
bordered: false,
|
||||||
split: true,
|
split: true,
|
||||||
loading: false,
|
loading: false,
|
||||||
pagination: false as ListProps['pagination'],
|
pagination: false as ListProps<any>['pagination'],
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
|
Loading…
Reference in New Issue
Block a user