From db766766335101db78a66be8b7ee08191dc2259a Mon Sep 17 00:00:00 2001 From: neverland Date: Sat, 9 Mar 2024 20:23:18 +0800 Subject: [PATCH] docs(ImagePreview): add vertical prop (#12663) --- packages/vant/src/image-preview/README.md | 2 ++ packages/vant/src/image-preview/README.zh-CN.md | 2 ++ packages/vant/src/image-preview/function-call.tsx | 1 + 3 files changed, 5 insertions(+) diff --git a/packages/vant/src/image-preview/README.md b/packages/vant/src/image-preview/README.md index 7ca4a86ed..ffe527247 100644 --- a/packages/vant/src/image-preview/README.md +++ b/packages/vant/src/image-preview/README.md @@ -212,6 +212,7 @@ Vant exports following ImagePreview utility functions: | doubleScale `v4.7.2` | Whether to enable double tap zoom gesture. When disabled, the image preview will be closed immediately upon clicking | _boolean_ | `true` | | closeOnClickImage `v4.8.3` | Whether to close when image is clicked | _boolean_ | `true` | | closeOnClickOverlay `v4.6.4` | Whether to close when overlay is clicked | _boolean_ | `true` | +| vertical `v4.8.6` | Whether to enable vertical gesture sliding | _boolean_ | `false` | | beforeClose | Callback function before close | _(action) => boolean \| Promise_ | - | | className | Custom className | _string \| Array \| object_ | - | | maxZoom | Max zoom | _number \| string_ | `3` | @@ -240,6 +241,7 @@ Vant exports following ImagePreview utility functions: | close-on-popstate | Whether to close when popstate | _boolean_ | `true` | | close-on-click-image `v4.8.3` | Whether to close when image is clicked | _boolean_ | `true` | | close-on-click-overlay `v4.6.4` | Whether to close when overlay is clicked | _boolean_ | `true` | +| vertical `v4.8.6` | Whether to enable vertical gesture sliding | _boolean_ | `false` | | class-name | Custom className (apply to Popup in image preview) | _string \| Array \| object_ | - | | max-zoom | Max zoom | _number \| string_ | `3` | | min-zoom | Min zoom | _number \| string_ | `1/3` | diff --git a/packages/vant/src/image-preview/README.zh-CN.md b/packages/vant/src/image-preview/README.zh-CN.md index c10fcedca..e69e8ebb0 100644 --- a/packages/vant/src/image-preview/README.zh-CN.md +++ b/packages/vant/src/image-preview/README.zh-CN.md @@ -216,6 +216,7 @@ Vant 中导出了以下 ImagePreview 相关的辅助函数: | closeOnPopstate | 是否在页面回退时自动关闭 | _boolean_ | `true` | | closeOnClickImage `v4.8.3` | 是否在点击图片后关闭图片预览 | _boolean_ | `true` | | closeOnClickOverlay `v4.6.4` | 是否在点击遮罩层后关闭图片预览 | _boolean_ | `true` | +| vertical `v4.8.6` | 是否开启纵向手势滑动 | _boolean_ | `false` | | className | 自定义类名 (应用在图片预览的弹出层) | _string \| Array \| object_ | - | | maxZoom | 手势缩放时,最大缩放比例 | _number \| string_ | `3` | | minZoom | 手势缩放时,最小缩放比例 | _number \| string_ | `1/3` | @@ -245,6 +246,7 @@ Vant 中导出了以下 ImagePreview 相关的辅助函数: | close-on-popstate | 是否在页面回退时自动关闭 | _boolean_ | `true` | | close-on-click-image `v4.8.3` | 是否在点击图片后关闭图片预览 | _boolean_ | `true` | | close-on-click-overlay `v4.6.4` | 是否在点击遮罩层后关闭图片预览 | _boolean_ | `true` | +| vertical `v4.8.6` | 是否开启纵向手势滑动 | _boolean_ | `false` | | class-name | 自定义类名 | _string \| Array \| object_ | - | | max-zoom | 手势缩放时,最大缩放比例 | _number \| string_ | `3` | | min-zoom | 手势缩放时,最小缩放比例 | _number \| string_ | `1/3` | diff --git a/packages/vant/src/image-preview/function-call.tsx b/packages/vant/src/image-preview/function-call.tsx index 04ba194e0..a38c2aa42 100644 --- a/packages/vant/src/image-preview/function-call.tsx +++ b/packages/vant/src/image-preview/function-call.tsx @@ -13,6 +13,7 @@ const defaultConfig: ImagePreviewOptions = { onScale: undefined, onClose: undefined, onChange: undefined, + vertical: false, teleport: 'body', className: '', showIndex: true,