Commit c5943094 authored by XieZhiXiong's avatar XieZhiXiong

feat: type为card时,超出数量限制不显示上传按钮

parent 8d6ae809
...@@ -180,6 +180,7 @@ export interface IUploaderProps { ...@@ -180,6 +180,7 @@ export interface IUploaderProps {
value: any[] value: any[]
listType?: UploadListType listType?: UploadListType
readOnly?: boolean readOnly?: boolean
maxCount?: number
} }
export const Upload = connect({ export const Upload = connect({
...@@ -284,7 +285,7 @@ export const Upload = connect({ ...@@ -284,7 +285,7 @@ export const Upload = connect({
onRemove={this.onRemoveHandler} onRemove={this.onRemoveHandler}
listType={'picture-card'} listType={'picture-card'}
> >
{!others.readOnly ? ( {!others.readOnly && (others.maxCount !== undefined ? this.state.value.length < others.maxCount : true) ? (
<UploadPlaceholder /> <UploadPlaceholder />
) : null} ) : null}
</AntdUpload> </AntdUpload>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment