diff --git a/components/upload/uploadList.tsx b/components/upload/uploadList.tsx index 82263e6028..79f78a1faf 100644 --- a/components/upload/uploadList.tsx +++ b/components/upload/uploadList.tsx @@ -59,14 +59,14 @@ export default class UploadList extends React.Component { } render() { - const { prefixCls } = this.props; - let list = this.props.items.map(file => { + const { prefixCls, items, listType } = this.props; + const list = items.map(file => { let progress; let icon = ; - if (this.props.listType === 'picture' || this.props.listType === 'picture-card') { + if (listType === 'picture' || listType === 'picture-card') { if (file.status === 'uploading' || (!file.thumbUrl && !file.url)) { - if (this.props.listType === 'picture-card') { + if (listType === 'picture-card') { icon =
文件上传中
; } else { icon = ; @@ -121,7 +121,7 @@ export default class UploadList extends React.Component { ) } { - this.props.listType === 'picture-card' && file.status !== 'uploading' + listType === 'picture-card' && file.status !== 'uploading' ? ( { }); const listClassNames = classNames({ [`${prefixCls}-list`]: true, - [`${prefixCls}-list-${this.props.listType}`]: true, + [`${prefixCls}-list-${listType}`]: true, }); return ( -
- - {list} - -
+ + {list} + ); } }