mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
34 lines
638 B
JavaScript
34 lines
638 B
JavaScript
import Carousel from 'react-slick';
|
|
import React from 'react';
|
|
import assign from 'object-assign';
|
|
|
|
const AntCarousel = React.createClass({
|
|
getDefaultProps() {
|
|
return {
|
|
dots: true,
|
|
arrows: false
|
|
};
|
|
},
|
|
render() {
|
|
let props = assign({}, this.props);
|
|
|
|
if (props.effect === 'fade') {
|
|
props.fade = true;
|
|
props.draggable = false;
|
|
}
|
|
|
|
let className = 'ant-carousel';
|
|
if (props.vertical) {
|
|
className = className + ' ant-carousel-vertical';
|
|
}
|
|
|
|
return (
|
|
<div className={className}>
|
|
<Carousel {...props} />
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
|
|
export default AntCarousel;
|