ant-design-vue/components/vc-slick/demo/Resizable.jsx

82 lines
1.6 KiB
Vue
Raw Normal View History

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
data() {
2018-07-20 08:13:21 +00:00
return {
display: true,
width: 600,
2019-01-12 03:33:27 +00:00
};
2018-07-20 08:13:21 +00:00
},
2019-01-12 03:33:27 +00:00
render() {
2018-07-20 08:13:21 +00:00
const settings = {
props: {
dots: true,
infinite: true,
speed: 500,
slidesToShow: 3,
slidesToScroll: 1,
},
2019-01-12 03:33:27 +00:00
};
2018-07-20 08:13:21 +00:00
return (
<div>
<h2> Resizable Collapsible </h2>
<button
2019-01-12 03:33:27 +00:00
class="button"
onClick={() => {
this.width = this.width + 100;
}}
2018-07-20 08:13:21 +00:00
>
{' '}
increase{' '}
</button>
<button
2019-01-12 03:33:27 +00:00
class="button"
onClick={() => {
this.width = this.width - 100;
}}
2018-07-20 08:13:21 +00:00
>
{' '}
decrease{' '}
</button>
<button
2019-01-12 03:33:27 +00:00
class="button"
onClick={() => {
this.display = !this.display;
}}
2018-07-20 08:13:21 +00:00
>
{' '}
toggle{' '}
</button>
<div
style={{
width: this.width + 'px',
display: this.display ? 'block' : 'none',
}}
>
<Slider {...settings}>
<div>
<h3>1</h3>
</div>
<div>
<h3>2</h3>
</div>
<div>
<h3>3</h3>
</div>
<div>
<h3>4</h3>
</div>
<div>
<h3>5</h3>
</div>
<div>
<h3>6</h3>
</div>
</Slider>
</div>
</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
};