2015-09-01 14:30:01 +08:00
|
|
|
import Carousel from 'react-slick';
|
2015-08-03 14:52:26 +08:00
|
|
|
import React from 'react';
|
|
|
|
import assign from 'object-assign';
|
|
|
|
|
2015-08-17 15:17:04 +08:00
|
|
|
const AntCarousel = React.createClass({
|
2015-08-03 14:52:26 +08:00
|
|
|
getDefaultProps() {
|
|
|
|
return {
|
|
|
|
dots: true,
|
|
|
|
arrows: false
|
|
|
|
};
|
|
|
|
},
|
|
|
|
render() {
|
2015-08-17 15:17:04 +08:00
|
|
|
let props = assign({}, this.props);
|
2015-08-03 14:52:26 +08:00
|
|
|
|
|
|
|
if (props.effect === 'fade') {
|
|
|
|
props.fade = true;
|
2015-08-28 13:55:36 +08:00
|
|
|
props.draggable = false;
|
2015-08-03 14:52:26 +08:00
|
|
|
}
|
|
|
|
|
2015-08-17 15:17:04 +08:00
|
|
|
let className = 'ant-carousel';
|
2015-08-03 14:52:26 +08:00
|
|
|
if (props.vertical) {
|
|
|
|
className = className + ' ant-carousel-vertical';
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={className}>
|
|
|
|
<Carousel {...props} />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export default AntCarousel;
|