mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[Doc] Uploader: add description of multiple prop
This commit is contained in:
parent
4a1abc04f6
commit
1e6f5a2f5f
@ -22,19 +22,6 @@
|
|||||||
</van-uploader>
|
</van-uploader>
|
||||||
</div>
|
</div>
|
||||||
</demo-block>
|
</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>
|
</demo-section>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -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
|
## API
|
||||||
|
|
||||||
### Props
|
### 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` |
|
| result-type | Type of file read result, can be set to `dataUrl` `text` | `String` | `dataUrl` |
|
||||||
| accept | Accepted file type | `String` | `image/*` |
|
| accept | Accepted file type | `String` | `image/*` |
|
||||||
| disabled | Whether to disabled the upload | `Boolean` | `false` |
|
| 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` | - |
|
| before-read | Hook before reading the file, return false to stop reading the file | `Function` | - |
|
||||||
| after-read | Hook after reading the file | `Function` | - |
|
| after-read | Hook after reading the file | `Function` | - |
|
||||||
| max-size | Max size of file | `Number` | - |
|
| max-size | Max size of file | `Number` | - |
|
||||||
|
@ -14,11 +14,5 @@ exports[`renders demo correctly 1`] = `
|
|||||||
<!----></i><input name="uploader" type="file" accept="image/*" class="van-uploader__input"></div>
|
<!----></i><input name="uploader" type="file" accept="image/*" class="van-uploader__input"></div>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@ -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
|
## API
|
||||||
|
|
||||||
### Props
|
### Props
|
||||||
@ -66,6 +56,7 @@ export default {
|
|||||||
| result-type | 文件读取结果类型,可选值为 `text` | `String` | `dataUrl` | - |
|
| result-type | 文件读取结果类型,可选值为 `text` | `String` | `dataUrl` | - |
|
||||||
| accept | 接受的文件类型 | `String` | `image/*` | - |
|
| accept | 接受的文件类型 | `String` | `image/*` | - |
|
||||||
| disabled | 是否禁用图片上传 | `Boolean` | `false` | - |
|
| disabled | 是否禁用图片上传 | `Boolean` | `false` | - |
|
||||||
|
| multiple | 是否开启图片多选,部分安卓机型不支持 | `Boolean` | `false` | 2.0.0 |
|
||||||
| before-read | 读取前的回调函数,返回 false 可终止文件读取 | `Function` | - | - |
|
| before-read | 读取前的回调函数,返回 false 可终止文件读取 | `Function` | - | - |
|
||||||
| after-read | 读取完成后的回调函数 | `Function` | - | - |
|
| after-read | 读取完成后的回调函数 | `Function` | - | - |
|
||||||
| max-size | 文件大小限制,单位为 byte | `Number` | - | - |
|
| max-size | 文件大小限制,单位为 byte | `Number` | - | - |
|
||||||
|
Loading…
x
Reference in New Issue
Block a user