[Doc] Uploader: add description of multiple prop

This commit is contained in:
陈嘉涵 2019-05-27 16:22:22 +08:00
parent 4a1abc04f6
commit 1e6f5a2f5f
4 changed files with 2 additions and 39 deletions

View File

@ -22,19 +22,6 @@
</van-uploader>
</div>
</demo-block>
<demo-block :title="$t('title2')">
<div class="demo-uploader-container">
<van-uploader
accept="image/gif, image/jpeg"
multiple
:max-size="36000"
@oversize="logContent"
>
<van-icon name="photograph" />
</van-uploader>
</div>
</demo-block>
</demo-section>
</template>

View File

@ -48,16 +48,6 @@ export default {
};
```
### Set input attrs
You can set native properties such as `accpet``multiple` on Uploader, and the input will automatically inherits the attribute.
```html
<van-uploader :after-read="onRead" accept="image/gif, image/jpeg" multiple>
<van-icon name="photograph" />
</van-uploader>
```
## API
### Props
@ -68,6 +58,7 @@ You can set native properties such as `accpet`、`multiple` on Uploader, and the
| result-type | Type of file read result, can be set to `dataUrl` `text` | `String` | `dataUrl` |
| accept | Accepted file type | `String` | `image/*` |
| disabled | Whether to disabled the upload | `Boolean` | `false` |
| multiple | Whether to enable multiple selection pictures | `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` | - |

View File

@ -14,11 +14,5 @@ exports[`renders demo correctly 1`] = `
<!----></i><input name="uploader" type="file" accept="image/*" class="van-uploader__input"></div>
</div>
</div>
<div>
<div class="demo-uploader-container">
<div class="van-uploader"><i class="van-icon van-icon-photograph">
<!----></i><input multiple="multiple" type="file" accept="image/gif, image/jpeg" class="van-uploader__input"></div>
</div>
</div>
</div>
`;

View File

@ -46,16 +46,6 @@ export default {
};
```
### 设置 Input 属性
可以直接在 Uploader 上设置 accpet、multiple 等原生属性input 会自动继承该属性
```html
<van-uploader :after-read="onRead" accept="image/gif, image/jpeg" multiple>
<van-icon name="photograph" />
</van-uploader>
```
## API
### Props
@ -66,6 +56,7 @@ export default {
| result-type | 文件读取结果类型,可选值为 `text` | `String` | `dataUrl` | - |
| accept | 接受的文件类型 | `String` | `image/*` | - |
| disabled | 是否禁用图片上传 | `Boolean` | `false` | - |
| multiple | 是否开启图片多选,部分安卓机型不支持 | `Boolean` | `false` | 2.0.0 |
| before-read | 读取前的回调函数,返回 false 可终止文件读取 | `Function` | - | - |
| after-read | 读取完成后的回调函数 | `Function` | - | - |
| max-size | 文件大小限制,单位为 byte | `Number` | - | - |