## Upload

> 内部调用的 [upload](https://github.com/react-component/upload)

## 属性

| 属性 | 说明 | 类型 | 默认值 |
| :--- | :--- | :--- | :--- |
| action | 上传 url | string | 空字符串 |
| className | 给组件额外添加的类名 | string | 空字符串 |
| src | 默认渲染的图片地址 | string | null |
| data | request 参数 | object | null |
| disabled | 禁用 | bool | false |
| beforeUpload | 上传前的回调 | func | 空函数 |
| onChange | 上传过程中的回调 | func | 空函数 |
| getImgInfo | 获取上传后的图片名次、url | func | 见下方说明 |

所有 [upload](https://github.com/react-component/upload) 支持的属性，该组件都支持



## 回调函数的说明

```js
beforeUpload: function(file) {
  return false; // 返回 false 会组织上传
}

onChange: function(file) {
  // file.status 可能为 uploading | done | error
  // 其中 done 表示上传上成功，并且 file.response 上挂在返回的结果
}

// format 上传成功返回的字段，默认按照现网接口处理
getImgInfo(response) {
  // response 是上次成功后返回的结构，一般有图片的链接
  const ret = response && response.result;

  // 这个函数的目的是拿到图片链接等信息，便于预览
  return ret ? {
    name: '',
    src: ret.url
  } : null;
}
```
