[new feature] Uploader: support maxSize prop (#575)

This commit is contained in:
neverland
2018-01-24 20:28:53 +08:00
committed by GitHub
parent 8f97bc9f0f
commit c89d82afc9
5 changed files with 97 additions and 20 deletions
+18 -5
View File
@@ -42,13 +42,26 @@ You can set native properties such as `accpet`、`multiple` on Uploader, and the
| Attribute | Description | Type | Default | Accepted Values |
|-----------|-----------|-----------|-------------|-------------|
| result-type | The way to read the file, read as base64; read as text | `String` | `dataUrl` | `text` |
| disable | Whether to disable the upload, set to true during the image upload to prevent users from clicking this component to upload pictures | `Boolean` | `false` | - |
| before-read | Hook before reading the file, the first parameter is the selected file, return false to stop reading the file | `Function` | - | - |
| after-read | Hook after reading the file, parameter format: { file ,content } | `Function` | - | - |
| result-type | Type of file read result | `String` | `dataUrl` | `text` |
| disable | Whether to disable the upload | `Boolean` | `false` | - |
| before-read | Hook before reading the file, return false to stop reading the file | `Function` | - | - |
| after-read | Hook after reading the file | `Function` | - | - |
| max-size | Max size of file | `Number` | - | - |
### Event
| Event | Description | Arguments |
|-----------|-----------|-----------|
| oversize | Triggered when file size over limit | Same as after-read |
### Slot
| name | Description |
| Name | Description |
|-----------|-----------|
| - | Custom icon |
### afterRead parematers
| Key | Description | Type |
|-----------|-----------|-----------|
| file | file object | `Object` |
| content | file content | `String` |