# OssUploader

## 数字选择

<div id="OssUploaderSample"></div>

<script type="text/javascript">
ReactDOM.render(React.createElement(OssUploaderSample),document.getElementById('OssUploaderSample'));
</script>

```javascript

```

## 属性

<div class="markdown-grid">

| 参数名             | 说明               | 必填 | 类型                                                                                                                                                                                                                 | 默认值   | 备注                                                                                                                        |
| ------------------ | ------------------ | ---- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------- |
| value              | 值                 | Y    | Item \| Item[]                                                                                                                                                                                                       | [] \| {} | 若 limit 不为 1，则 value 为数组，若 onlyUrl 为 true，则 value 每一项为 string                                              |
| bizType            | 业务类型           | Y    | 'articleMaterial' \| 'frontImage' \| 'brandLogo' \| 'buyerProof' \| 'sellerProof' \| 'counselorProof' \| 'merchantProof' \| 'idcardImage' \| 'itemImage' \| 'itemVideo' \| 'snapshot' \| 'itemDescription' \| 'CRDI' |          | bizType 需要和 uploadType、uploadScene 保持对应关系，其关系可见下面的说明（在搭建场景下可以自动生成，源码场景需要手动指定） |
| uploadType         | 上传文件类型       | N    | 'image' \| 'video' \| 'xls' \| 'all'                                                                                                                                                                                 | 'image'  |                                                                                                                             |
| uploadScene        | bizName            | N    | 'item' \| 'category' \| 'store' \| 'reverse' \| 'trade' \| 'crm' \| 'CRDI'                                                                                                                                           | 'item'   |                                                                                                                             |
| uploadHint         | 上传提示信息       | N    | React.ReactElement                                                                                                                                                                                                   | null     |                                                                                                                             |
| onlyUrl            | 只使用 url         | N    | boolean                                                                                                                                                                                                              | true     | 若开启，则 value 为 string 或 string[]，否则为 Item 或 Item[]                                                               |
| getOssSignatureUrl | 自定义获取签名 url | N    | string                                                                                                                                                                                                               |          | 需确保接口出入参一致                                                                                                        |
| uploadCallbackUrl  | oss 回调 url       | N    | string                                                                                                                                                                                                               |          | 需确保接口出入参一致                                                                                                        |
| onInit             | 组件初始化回调     | N    | () => void                                                                                                                                                                                                           |          |                                                                                                                             |
| onChange           | 值变化回调         | N    | (Item \| Item[]) => void                                                                                                                                                                                             |          | 入参与 value 格式一致                                                                                                       |

</div>
