diff --git a/components/upload/index.en-US.md b/components/upload/index.en-US.md index 217438ae7272..d2c4a438a632 100644 --- a/components/upload/index.en-US.md +++ b/components/upload/index.en-US.md @@ -20,18 +20,18 @@ Uploading is the process of publishing information (web pages, text, pictures, v | Property | Description | Type | Default| |------------|----------------------------------------------------| ----------- |--------| -| name | Optional. The name of uploading file | String | file | -| defaultFileList | Optional. Default list of files that have been uploaded. | Array[Object] | - | -| fileList | Optional. List of files that have been uploaded. | Array[Object] | - | +| name | The name of uploading file | String | 'file' | +| defaultFileList | Default list of files that have been uploaded. | Array[Object] | - | +| fileList | List of files that have been uploaded (controlled). Here is a common issue [#2423](https://github.com/ant-design/ant-design/issues/2423) when using it | Array[Object] | - | | action | Required. Uploading URL | String | - | -| data | Optional. Uploading params or function which can return uploading params. | Object or function(file) | - | -| headers | Optional. Set request headers, valid above IE10. | Object | - | -| showUploadList | Optional. Whether to show uploadList. | Boolean | true | -| multiple | Optional. Whether to support selected multiple file. `IE10+` supported. You can select multiple files with CTRL holding down while multiple is set to be true | Boolean | false | -| accept | Optional. File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | String | - | -| beforeUpload | Optional. Hook function which takes an argument: the uploaded file, will be executed before uploading. Uploading will be stopped with `false` or a rejected Promise returned. **Warning:this function is not supported by old IE**。 | Function | - | -| onChange | Optional. A callback function, can be executed when uploading state is changing. See [onChange](#onChange) | Function | - | -| listType | Optional. Built-in stylesheets, support for two types: `text` or `picture` | String | 'text'| +| data | Uploading params or function which can return uploading params. | Object or function(file) | - | +| headers | Set request headers, valid above IE10. | Object | - | +| showUploadList | Whether to show uploadList. | Boolean | true | +| multiple | Whether to support selected multiple file. `IE10+` supported. You can select multiple files with CTRL holding down while multiple is set to be true | Boolean | false | +| accept | File types that can be accepted. See [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | String | - | +| beforeUpload | Hook function which takes an argument: the uploaded file, will be executed before uploading. Uploading will be stopped with `false` or a rejected Promise returned. **Warning:this function is not supported by old IE**。 | Function | - | +| onChange | A callback function, can be executed when uploading state is changing. See [onChange](#onChange) | Function | - | +| listType | Built-in stylesheets, support for two types: `text` or `picture` | String | 'text'| | onPreview | A callback function, will be executed when file link is clicked. | Function(file) | - | | onRemove | A callback function, will be executed when removing file button is clicked | Function(file) | - | | supportServerRender | Need to be turned on while the server side is rendering.| Boolean | false | diff --git a/components/upload/index.zh-CN.md b/components/upload/index.zh-CN.md index 92cbde2c20e5..4f8ab7f03151 100644 --- a/components/upload/index.zh-CN.md +++ b/components/upload/index.zh-CN.md @@ -21,17 +21,17 @@ title: Upload | 参数 | 说明 | 类型 | 默认值| |------------|--------------------------------------------------------------| ----------- |-------| -| name | 可选参数, 上传的文件 | String | file | -| defaultFileList | 可选参数,默认已经上传的文件列表 | Array[Object] | 无 | -| fileList | 可选参数,已经上传的文件列表 | Array[Object] | 无 | +| name | 发到后台的文件参数名 | String | 'file' | +| defaultFileList | 默认已经上传的文件列表 | Array[Object] | 无 | +| fileList | 已经上传的文件列表(受控),使用此参数时,如果遇到 `onChange` 只调用一次的问题,请参考 [#2423](https://github.com/ant-design/ant-design/issues/2423) | Array[Object] | 无 | | action | 必选参数, 上传的地址 | String | 无 | -| data | 可选参数, 上传所需参数或返回上传参数的方法 | Object or function(file) | 无 | -| headers | 可选参数, 设置上传的请求头部,IE10 以上有效 | Object | 无 | -| showUploadList | 可选参数, 是否展示 uploadList, 默认开启 | Boolean | true | -| multiple | 可选参数, 是否支持多选文件,`ie10+` 支持。开启后按住 ctrl 可选择多个文件。 | Boolean | false | -| accept | 可选参数, 接受上传的文件类型, 详见 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | String | 无 | -| beforeUpload | 可选参数, 上传文件之前的钩子,参数为上传的文件,若返回 `false` 或者 Promise 则停止上传。**注意:该方法不支持老 IE**。 | Function | 无 | -| onChange | 可选参数, 上传文件改变时的状态,详见 onChange | Function | 无 | +| data | 上传所需参数或返回上传参数的方法 | Object or function(file) | 无 | +| headers | 设置上传的请求头部,IE10 以上有效 | Object | 无 | +| showUploadList | 是否展示 uploadList, 默认开启 | Boolean | true | +| multiple | 是否支持多选文件,`ie10+` 支持。开启后按住 ctrl 可选择多个文件。 | Boolean | false | +| accept | 接受上传的文件类型, 详见 [input accept Attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-accept) | String | 无 | +| beforeUpload | 上传文件之前的钩子,参数为上传的文件,若返回 `false` 或者 Promise 则停止上传。**注意:该方法不支持老 IE**。 | Function | 无 | +| onChange | 上传文件改变时的状态,详见 onChange | Function | 无 | | listType | 上传列表的内建样式,支持两种基本样式 `text` or `picture` | String | 'text'| | onPreview | 点击文件链接时的回调 | Function(file) | 无 | | onRemove | 点击移除文件时的回调 | Function(file) | 无 |