Skip to content

Commit

Permalink
temp(Upload): add jsdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
tao1991123 committed Jan 14, 2019
1 parent 8b133e1 commit 86f5f1f
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/upload/upload.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,25 @@ class Upload extends Base {
onChange: PropTypes.func,
/**
* 可选参数,上传成功回调函数,参数为请求下响应信息以及文件
* @param {Object} file 文件
* @param {Array<Object>} value 值
*/
onSuccess: PropTypes.func,
/**
* 可选参数, 用于校验文件,afterSelect仅在 autoUpload=false 的时候生效,autoUpload=true时,可以使用beforeUpload完全可以替代该功能.
* @param {Object} file
* @returns {Boolean} 返回false会阻止上传,其他则表示正常
*/
afterSelect: PropTypes.func,
/**
* 移除文件回调函数,详见 [onRemove](#onRemove)
*/
onRemove: PropTypes.func,
/**
* 可选参数,上传失败回调函数,参数为上传失败的信息、响应信息以及文件
* @param {Object} error 错误信息
* @param {Object} xhr 请求对象
* @param {Object} file 文件
*/
onError: PropTypes.func,
/**
Expand Down Expand Up @@ -126,12 +137,7 @@ class Upload extends Base {
* 自动上传
*/
autoUpload: PropTypes.bool,
/**
* 可选参数, 用于校验文件,afterSelect仅在 autoUpload=false 的时候生效,autoUpload=true时,可以使用beforeUpload完全可以替代该功能.
* @param {Object} file
* @returns {Boolean} 返回false会阻止上传,其他则表示正常
*/
afterSelect: PropTypes.func,

};

static defaultProps = {
Expand Down

0 comments on commit 86f5f1f

Please sign in to comment.