UNPKG

test-nut-ui

Version:

<p align="center"> <img alt="logo" src="https://img11.360buyimg.com/imagetools/jfs/t1/211965/25/7152/22022/61b16785E433119bb/aa41d7a9f7e823f3.png" width="150" style="margin-bottom: 10px;"> </p>

104 lines (103 loc) 2.3 kB
import { FunctionComponent, ReactNode } from 'react'; import { BasicComponent } from '../../utils/typings'; import '@nascent/nutui-icons-react/lib/style.css'; export type NumberPositionType = 'top' | 'bottom'; export type NumberAlignType = 'center' | 'left' | 'right'; export interface ImagePreviewProps extends BasicComponent { /** * 预览图片数组 * @default [] */ images: Array<{ src: string; needScroll?: boolean; desc?: string; }> /** * 预览的视频数组(视频自动放到图片之前) * @default [] */ videos: Array<{ source: { src: string; type: string; }; options: { muted: boolean; controls: boolean; }; }> /** * 是否展示预览图片 * @default false */ visible: boolean /** * 自动轮播时长,0表示不会自动轮播 * @default 3000 */ autoPlay: number | string /** * 页码,受控 * @default 1 */ value?: number /** * 初始页码 * @default 1 */ defaultValue: number /** * 是否显示编号 * @default false */ showNumber: boolean /** * 编号显示位置(上下) * @default top */ numberPosition: NumberPositionType /** * 编号显示位置(左中右) * @default center */ numberAlign: NumberAlignType /** * 是否显示关闭按钮 * @default false */ showClose: boolean /** * 点击图片可以退出预览 * @default false */ closeOnContentClick: boolean /** * 分页指示器是否展示 * @default false */ indicator: boolean /** * 分页指示器默认的颜色 * @default #595959 */ indicatorColor: string /** * 分页指示器选中的颜色 * @default #fff */ indicatorActiveColor: string /** * 分页指示器底部距离 * @default 32px */ indicatorBottom: string errorImage: boolean | ReactNode; onChange: (value: number) => void; /** * 点击遮罩关闭图片预览时触发 * @default - */ onClose: () => void } export declare const ImagePreview: FunctionComponent<Partial<ImagePreviewProps>>;