From c42bbcfc61ea7acf78c75d3096c1afdd99dc3622 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BE=89?= <49851571+suncohey@users.noreply.github.com> Date: Sat, 9 Mar 2024 18:28:45 +0800 Subject: [PATCH] feat(ImagePreview): add vertical prop (#12660) Co-authored-by: sunguohui --- packages/vant/src/image-preview/ImagePreview.tsx | 2 ++ packages/vant/src/image-preview/types.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/packages/vant/src/image-preview/ImagePreview.tsx b/packages/vant/src/image-preview/ImagePreview.tsx index 6240ce9b4..e2e2a2398 100644 --- a/packages/vant/src/image-preview/ImagePreview.tsx +++ b/packages/vant/src/image-preview/ImagePreview.tsx @@ -60,6 +60,7 @@ export const imagePreviewProps = { minZoom: makeNumericProp(1 / 3), maxZoom: makeNumericProp(3), overlay: truthProp, + vertical: Boolean, closeable: Boolean, showIndex: truthProp, className: unknownProp, @@ -159,6 +160,7 @@ export default defineComponent({ lazyRender loop={props.loop} class={bem('swipe')} + vertical={props.vertical} duration={props.swipeDuration} initialSwipe={props.startPosition} showIndicators={props.showIndicators} diff --git a/packages/vant/src/image-preview/types.ts b/packages/vant/src/image-preview/types.ts index f0942ada6..be2f72c52 100644 --- a/packages/vant/src/image-preview/types.ts +++ b/packages/vant/src/image-preview/types.ts @@ -14,6 +14,7 @@ export type ImagePreviewOptions = { images: string[]; maxZoom?: number; minZoom?: number; + vertical?: boolean; teleport?: TeleportProps['to']; className?: unknown; showIndex?: boolean;