Skip to content

Commit

Permalink
feat: 图片预览新增“vertical”属性 配置是否纵向滚动
Browse files Browse the repository at this point in the history
  • Loading branch information
sunguohui committed Mar 8, 2024
1 parent c134bdb commit 316abeb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/vant/src/image-preview/ImagePreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const imagePreviewProps = {
minZoom: makeNumericProp(1 / 3),
maxZoom: makeNumericProp(3),
overlay: truthProp,
vertical: Boolean,
closeable: Boolean,
showIndex: truthProp,
className: unknownProp,
Expand Down Expand Up @@ -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}
Expand Down
9 changes: 9 additions & 0 deletions packages/vant/src/image-preview/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
/*
* @Author: sunguohui
* @Date: 2024-03-08 11:02:22
* @LastEditors: sunguohui
* @LastEditTime: 2024-03-08 11:09:08
* @FilePath: \vant\src\image-preview\types.ts
* @Description:
*/
import type {
CSSProperties,
TeleportProps,
Expand All @@ -14,6 +22,7 @@ export type ImagePreviewOptions = {
images: string[];
maxZoom?: number;
minZoom?: number;
vertical?: boolean;
teleport?: TeleportProps['to'];
className?: unknown;
showIndex?: boolean;
Expand Down

0 comments on commit 316abeb

Please sign in to comment.