feat(Uploader): add lazy-load prop (#6083)

This commit is contained in:
neverland 2020-04-18 08:39:32 +08:00 committed by GitHub
parent 8f3baa3449
commit 859df7bde7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 0 deletions

View File

@ -161,6 +161,7 @@ export default {
| disabled | Whether to disabled the upload | _boolean_ | `false` |
| deletable `v2.2.12` | Whether to show delete icon | _boolean_ | `true` |
| show-upload `v2.5.6` | Whether to show upload area | _boolean_ | `true` |
| lazy-load `v2.6.2` | Whether to enable lazy loadshould register [Lazyload](#/en-US/lazyload) component | _boolean_ | `false` |
| capture | Capturecan be set to `camera` | _string_ | - |
| after-read | Hook after reading the file | _Function_ | - |
| before-read | Hook before reading the file, return false to stop reading the file, can return Promise | _Function_ | - |

View File

@ -183,6 +183,7 @@ export default {
| disabled | 是否禁用文件上传 | _boolean_ | `false` |
| deletable `v2.2.12` | 是否展示删除按钮 | _boolean_ | `true` |
| show-upload `v2.5.6` | 是否展示上传区域 | _boolean_ | `true` |
| lazy-load `v2.6.2` | 是否开启图片懒加载,须配合 [Lazyload](#/zh-CN/lazyload) 组件使用 | _boolean_ | `false` |
| capture | 图片选取模式,可选值为`camera`(直接调起摄像头) | _string_ | - |
| after-read | 文件读取完成后的回调函数 | _Function_ | - |
| before-read | 文件读取前的回调函数,返回`false`可终止文件读取,<br>支持返回`Promise` | _Function_ | - |

View File

@ -24,6 +24,7 @@ export default createComponent({
props: {
disabled: Boolean,
lazyLoad: Boolean,
uploadText: String,
afterRead: Function,
beforeRead: Function,
@ -301,6 +302,7 @@ export default createComponent({
class={bem('preview-image')}
width={this.previewSize}
height={this.previewSize}
lazyLoad={this.lazyLoad}
onClick={() => {
this.onPreviewImage(item);
}}