From 707729a5441082ae585780e6b304840ae2e11b20 Mon Sep 17 00:00:00 2001 From: neverland Date: Wed, 26 Jun 2019 17:11:57 +0800 Subject: [PATCH] [bugfix] ImagePreview: should lock scroll (#3645) --- packages/image-preview/ImagePreview.js | 15 ++++++++------- packages/uploader/zh-CN.md | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/packages/image-preview/ImagePreview.js b/packages/image-preview/ImagePreview.js index cd947f7f4..2a40fcbde 100644 --- a/packages/image-preview/ImagePreview.js +++ b/packages/image-preview/ImagePreview.js @@ -165,7 +165,7 @@ export default sfc({ this.startDistance = getDistance(event.touches); }, - onTouchStart(event) { + onImageTouchStart(event) { const { touches } = event; const { offsetX = 0 } = this.$refs.swipe || {}; @@ -176,7 +176,7 @@ export default sfc({ } }, - onTouchMove(event) { + onImageTouchMove(event) { const { touches } = event; if (this.moving || this.zooming) { preventDefault(event, true); @@ -197,7 +197,7 @@ export default sfc({ } }, - onTouchEnd(event) { + onImageTouchEnd(event) { /* istanbul ignore else */ if (this.moving || this.zooming) { let stopPropagation = true; @@ -268,10 +268,10 @@ export default sfc({ class: bem('image'), style: index === active ? this.imageStyle : null, on: { - touchstart: this.onTouchStart, - touchmove: this.onTouchMove, - touchend: this.onTouchEnd, - touchcancel: this.onTouchEnd + touchstart: this.onImageTouchStart, + touchmove: this.onImageTouchMove, + touchend: this.onImageTouchEnd, + touchcancel: this.onImageTouchEnd } }; return ( @@ -292,6 +292,7 @@ export default sfc({
diff --git a/packages/uploader/zh-CN.md b/packages/uploader/zh-CN.md index 204d3e3b6..1d8de0ed1 100644 --- a/packages/uploader/zh-CN.md +++ b/packages/uploader/zh-CN.md @@ -124,7 +124,7 @@ export default { | name | 标识符,可以在回调函数的第二项参数中获取 | `String` | - | 1.6.13 | | accept | 接受的文件类型 | `String` | `image/*` | - | | preview-image | 是否在上传完成后展示预览图 | `Boolean` | `true` | 2.0.0 | -| preview-size | 预览图和上传区域的尺寸,单位为`px` | `String | Number` | `80px` | 2.0.0 | +| preview-size | 预览图和上传区域的尺寸,默认单位为`px` | `String | Number` | `80px` | 2.0.0 | | multiple | 是否开启图片多选,部分安卓机型不支持 | `Boolean` | `false` | 2.0.0 | | disabled | 是否禁用文件上传 | `Boolean` | `false` | - | | capture | 图片选取模式,可选值为`camera`(直接调起摄像头) | `String` | - | 2.0.0 |