|
@@ -3,6 +3,10 @@ import { Upload, Icon, Modal } from 'antd';
|
3
|
3
|
import './style.less';
|
4
|
4
|
import { uploaderProps } from '../../utils/upload';
|
5
|
5
|
|
|
6
|
+/**
|
|
7
|
+ * unlimited 属性表示上传图片无限制
|
|
8
|
+ * 例子: <ImageListUpload unlimited/>
|
|
9
|
+ */
|
6
|
10
|
class ImageListUpload extends React.Component {
|
7
|
11
|
state = {
|
8
|
12
|
previewVisible: false,
|
|
@@ -79,7 +83,8 @@ class ImageListUpload extends React.Component {
|
79
|
83
|
{ ...uploaderProps }
|
80
|
84
|
onSuccess={this.handleUploadSucess}
|
81
|
85
|
>
|
82
|
|
- {(fileList || images).length >= 8 ? null : uploadButton}
|
|
86
|
+ {/* unlimited 表示上传无限制数量 */}
|
|
87
|
+ {(this.props.unlimited && uploadButton) || ((fileList || images).length >= 8 ? null : uploadButton)}
|
83
|
88
|
</Upload>
|
84
|
89
|
<Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
|
85
|
90
|
<img alt="example" style={{ width: '100%' }} src={previewImage} />
|