mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-02 03:58:05 +08:00
feat: Carousel support responsive #1230
This commit is contained in:
parent
b4fe21139a
commit
c89d19e6e1
@ -64,6 +64,7 @@ export const CarouselProps = {
|
||||
variableWidth: PropTypes.bool,
|
||||
useCSS: PropTypes.bool,
|
||||
slickGoTo: PropTypes.number,
|
||||
responsive: PropTypes.array.def(null),
|
||||
};
|
||||
|
||||
const Carousel = {
|
||||
|
@ -31,7 +31,7 @@ const defaultProps = {
|
||||
pauseOnFocus: PropTypes.bool.def(false),
|
||||
// hover是否暂停
|
||||
pauseOnHover: PropTypes.bool.def(true),
|
||||
responsive: PropTypes.any.def(null),
|
||||
responsive: PropTypes.array.def(null),
|
||||
rows: PropTypes.number.def(1),
|
||||
rtl: PropTypes.bool.def(false),
|
||||
slide: PropTypes.string.def('div'),
|
||||
|
47
types/carousel.d.ts
vendored
47
types/carousel.d.ts
vendored
@ -4,6 +4,51 @@
|
||||
|
||||
import { AntdComponent } from './component';
|
||||
|
||||
export interface Settings {
|
||||
accessibility?: boolean;
|
||||
adaptiveHeight?: boolean;
|
||||
arrows?: boolean;
|
||||
autoplaySpeed?: number;
|
||||
autoplay?: boolean;
|
||||
centerMode?: boolean;
|
||||
centerPadding?: string;
|
||||
className?: string;
|
||||
cssEase?: string;
|
||||
dotsClass?: string;
|
||||
dots?: boolean;
|
||||
draggable?: boolean;
|
||||
easing?: string;
|
||||
edgeFriction?: number;
|
||||
fade?: boolean;
|
||||
focusOnSelect?: boolean;
|
||||
infinite?: boolean;
|
||||
initialSlide?: number;
|
||||
pauseOnDotsHover?: boolean;
|
||||
pauseOnFocus?: boolean;
|
||||
pauseOnHover?: boolean;
|
||||
responsive?: ResponsiveObject[];
|
||||
rows?: number;
|
||||
rtl?: boolean;
|
||||
slide?: string;
|
||||
slidesPerRow?: number;
|
||||
slidesToScroll?: number;
|
||||
slidesToShow?: number;
|
||||
speed?: number;
|
||||
swipeToSlide?: boolean;
|
||||
swipe?: boolean;
|
||||
touchMove?: boolean;
|
||||
touchThreshold?: number;
|
||||
useCSS?: boolean;
|
||||
useTransform?: boolean;
|
||||
variableWidth?: boolean;
|
||||
vertical?: boolean;
|
||||
verticalSwiping?: boolean;
|
||||
waitForAnimate?: boolean;
|
||||
}
|
||||
export interface ResponsiveObject {
|
||||
breakpoint: number;
|
||||
settings: 'unslick' | Settings;
|
||||
}
|
||||
export declare class Carousel extends AntdComponent {
|
||||
/**
|
||||
* Callback function called after the current index changes
|
||||
@ -52,6 +97,8 @@ export declare class Carousel extends AntdComponent {
|
||||
*/
|
||||
vertical: boolean;
|
||||
|
||||
responsive: ResponsiveObject[];
|
||||
|
||||
/**
|
||||
* Go to slide index, if dontAnimate=true, it happens without animation
|
||||
* @param slideNumber slide number to go
|
||||
|
Loading…
Reference in New Issue
Block a user