@nutui/nutui-react
Version:
京东风格的轻量级移动端 React 组件库,支持一套代码生成 H5 和小程序
57 lines (56 loc) • 1.3 kB
TypeScript
import { default as React, ReactNode } from 'react';
import { BasicComponent } from '../../utils/typings';
import { SwiperRef } from './types';
export interface FocusEffect {
name: 'focus';
scale: number;
}
export interface SwiperProps extends BasicComponent {
/**
* 轮播方向
* @default horizontal
*/
direction: 'horizontal' | 'vertical'
/**
* 分页指示器是否展示,可传入自定义的 HTML 结构
* @default false
*/
indicator: ReactNode
/**
* 是否循环轮播
* @default true
*/
loop: boolean
/**
* 动画时长(单位是ms)
* @default 500
*/
duration: number | string
/**
* 自动轮播时长,0表示不会自动轮播
* @default 0
*/
autoPlay: boolean | number
/**
* 初始化索引值
* @default 0
*/
defaultValue: number
/**
* 是否可触摸滑动
* @default true
*/
touchable: boolean
effect: FocusEffect | undefined;
/**
* 轮播卡片的尺寸
* @default -
*/
slideSize?: number
/**
* 卡片切换后的回调
* @default -
*/
onChange?: (index: number) => void
}
export declare const Swiper: React.ForwardRefExoticComponent<Partial<SwiperProps> & React.RefAttributes<SwiperRef>>;