Skip to content

Commit

Permalink
feat(Upload): add videoFit prop (#5475)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsonwong666 authored Jul 10, 2023
1 parent 8309c27 commit f26de0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/uploader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ uploadFilePromise(fileName, chooseResult) {
| max-size | 文件大小限制,单位为`byte` | _number_ | - |
| max-count | 文件上传数量限制 | _number_ | - |
| upload-text | 上传区域文字提示 | _string_ | - |
| video-fit `1.10.21` | video 封面的预览图模式,可选值参考小程序`video`组件的`object-fit`属性 | _string_ | `contain` |
| image-fit | 预览图裁剪模式,可选值参考小程序`image`组件的`mode`属性 | _string_ | `scaleToFill` |
| use-before-read | 是否开启文件读取前事件 | _boolean_ | - |
| camera | 当 accept 为 `video` \| `media` 时生效,可选值为 `back` `front` | _string_ | - |
Expand Down
4 changes: 4 additions & 0 deletions packages/uploader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ VantComponent({
type: Boolean,
value: true,
},
videoFit: {
type: String,
value: 'contain',
},
imageFit: {
type: String,
value: 'scaleToFill',
Expand Down
1 change: 1 addition & 0 deletions packages/uploader/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
title="{{ item.name || ('视频' + index) }}"
poster="{{ item.thumb }}"
autoplay="{{ item.autoplay }}"
object-fit="{{videoFit}}"
class="van-uploader__preview-image"
style="{{ computed.sizeStyle({ previewSize }) }}"
data-index="{{ index }}"
Expand Down

0 comments on commit f26de0c

Please sign in to comment.