feat(Uploader): add upload-icon props (#2869)

This commit is contained in:
Lindy 2020-03-16 15:49:30 +08:00 committed by GitHub
parent d1d19fed91
commit 9a3b5df803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -181,6 +181,7 @@ uploadFilePromise(fileName, chooseResult) {
| camera | 当 accept 为 `video` 时生效,可选值为 `back` `front` | _string_ | - | - | | camera | 当 accept 为 `video` 时生效,可选值为 `back` `front` | _string_ | - | - |
| compressed | 当 accept 为 `video` 时生效,是否压缩视频,默认为`true` | _boolean_ | - | - | | compressed | 当 accept 为 `video` 时生效,是否压缩视频,默认为`true` | _boolean_ | - | - |
| max-duration | 当 accept 为 `video` 时生效,拍摄视频最长拍摄时间,单位秒 | _number_ | - | - | | max-duration | 当 accept 为 `video` 时生效,拍摄视频最长拍摄时间,单位秒 | _number_ | - | - |
| upload-icon | 上传区域图标,可选值见 [Icon 组件](#/icon) | *string* | `plus` | - |
### Slot ### Slot

View File

@ -71,6 +71,10 @@ VantComponent({
maxDuration: { maxDuration: {
type: Number, type: Number,
value: 60 value: 60
},
uploadIcon: {
type: String,
value: 'plus'
} }
}, },

View File

@ -49,7 +49,7 @@
style="width: {{ utils.addUnit(previewSize) }}; height: {{ utils.addUnit(previewSize) }};" style="width: {{ utils.addUnit(previewSize) }}; height: {{ utils.addUnit(previewSize) }};"
bind:tap="startUpload" bind:tap="startUpload"
> >
<van-icon name="plus" class="van-uploader__upload-icon" /> <van-icon name="{{ uploadIcon }}" class="van-uploader__upload-icon" />
<text wx:if="{{ uploadText }}" class="van-uploader__upload-text">{{ uploadText }}</text> <text wx:if="{{ uploadText }}" class="van-uploader__upload-text">{{ uploadText }}</text>
</view> </view>
</block> </block>