mirror of
https://gitee.com/vant-contrib/vant-weapp.git
synced 2025-04-05 19:41:45 +08:00
feat(Uploader): make upload botton selectable (#2868)
This commit is contained in:
parent
ebf1d40a19
commit
d1d19fed91
@ -29,6 +29,18 @@
|
||||
/>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="隐藏上传按钮" padding>
|
||||
<van-uploader
|
||||
name="2"
|
||||
file-list="{{ fileList2 }}"
|
||||
multiple
|
||||
show-upload="{{ false }}"
|
||||
bind:after-read="afterRead"
|
||||
bind:delete="delete"
|
||||
bind:click-preview="clickPreview"
|
||||
/>
|
||||
</demo-block>
|
||||
|
||||
<demo-block title="限制上传数量" padding>
|
||||
<van-uploader
|
||||
name="3"
|
||||
|
@ -169,6 +169,7 @@ uploadFilePromise(fileName, chooseResult) {
|
||||
| preview-full-image | 是否在点击预览图后展示全屏图片预览 | _boolean_ | `true` | - |
|
||||
| multiple | 是否开启图片多选,部分安卓机型不支持 | _boolean_ | `false` | - |
|
||||
| disabled | 是否禁用文件上传 | _boolean_ | `false` | - |
|
||||
| show-upload | 是否展示文件上传按钮 | _boolean_ | `true` | - |
|
||||
| deletable | 是否展示删除按钮 | _boolean_ | `true` | - |
|
||||
| capture | 图片或者视频选取模式,当`accept`为`image`类型时设置`capture`可选值为`camera`可以直接调起摄像头 | _string \| string[]_ | `['album', 'camera']` | - |
|
||||
| disabled | 是否禁用文件上传 | _boolean_ | `false` | - |
|
||||
|
@ -44,6 +44,10 @@ VantComponent({
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
showUpload: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
},
|
||||
previewImage: {
|
||||
type: Boolean,
|
||||
value: true
|
||||
|
@ -44,6 +44,7 @@
|
||||
|
||||
<!-- 默认上传样式 -->
|
||||
<view
|
||||
wx:if="{{ showUpload }}"
|
||||
class="van-uploader__upload {{ disabled ? 'van-uploader__upload--disabled': ''}}"
|
||||
style="width: {{ utils.addUnit(previewSize) }}; height: {{ utils.addUnit(previewSize) }};"
|
||||
bind:tap="startUpload"
|
||||
|
Loading…
x
Reference in New Issue
Block a user