2019-01-12 03:33:27 +00:00
|
|
|
import '../assets/index.less';
|
|
|
|
import Slider from '../src/slider';
|
2018-07-20 08:13:21 +00:00
|
|
|
|
|
|
|
export default {
|
2019-01-12 03:33:27 +00:00
|
|
|
render() {
|
2018-07-20 08:13:21 +00:00
|
|
|
const settings = {
|
|
|
|
class: 'slider variable-width',
|
|
|
|
props: {
|
|
|
|
dots: true,
|
|
|
|
infinite: true,
|
|
|
|
centerMode: true,
|
|
|
|
slidesToShow: 1,
|
|
|
|
slidesToScroll: 1,
|
|
|
|
variableWidth: true,
|
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
};
|
2018-07-20 08:13:21 +00:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<h2>Variable width</h2>
|
|
|
|
<Slider {...settings}>
|
|
|
|
<div style={{ width: '100px' }}>
|
|
|
|
<p>100</p>
|
|
|
|
</div>
|
|
|
|
<div style={{ width: '200px' }}>
|
|
|
|
<p>200</p>
|
|
|
|
</div>
|
|
|
|
<div style={{ width: '75px' }}>
|
|
|
|
<p>75</p>
|
|
|
|
</div>
|
|
|
|
<div style={{ width: '300px' }}>
|
|
|
|
<p>300</p>
|
|
|
|
</div>
|
|
|
|
<div style={{ width: '225px' }}>
|
|
|
|
<p>225</p>
|
|
|
|
</div>
|
|
|
|
<div style={{ width: '175px' }}>
|
|
|
|
<p>175</p>
|
|
|
|
</div>
|
|
|
|
</Slider>
|
|
|
|
</div>
|
2019-01-12 03:33:27 +00:00
|
|
|
);
|
2018-07-20 08:13:21 +00:00
|
|
|
},
|
2019-01-12 03:33:27 +00:00
|
|
|
};
|