Skip to content

Commit

Permalink
feat(Uploader): add upload-icon props (#2869)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lindysen committed Mar 16, 2020
1 parent d1d19fe commit 9a3b5df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/uploader/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ uploadFilePromise(fileName, chooseResult) {
| camera | 当 accept 为 `video` 时生效,可选值为 `back` `front` | _string_ | - | - |
| compressed | 当 accept 为 `video` 时生效,是否压缩视频,默认为`true` | _boolean_ | - | - |
| max-duration | 当 accept 为 `video` 时生效,拍摄视频最长拍摄时间,单位秒 | _number_ | - | - |
| upload-icon | 上传区域图标,可选值见 [Icon 组件](#/icon) | *string* | `plus` | - |

### Slot

Expand Down
4 changes: 4 additions & 0 deletions packages/uploader/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ VantComponent({
maxDuration: {
type: Number,
value: 60
},
uploadIcon: {
type: String,
value: 'plus'
}
},

Expand Down
2 changes: 1 addition & 1 deletion packages/uploader/index.wxml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
style="width: {{ utils.addUnit(previewSize) }}; height: {{ utils.addUnit(previewSize) }};"
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>
</view>
</block>
Expand Down

0 comments on commit 9a3b5df

Please sign in to comment.