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

73 lines
1.3 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 {
nav1: null,
nav2: null,
2019-01-12 03:33:27 +00:00
};
2018-07-20 08:13:21 +00:00
},
2019-01-12 03:33:27 +00:00
mounted() {
this.nav1 = this.$refs.slider1;
this.nav2 = this.$refs.slider2;
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
return (
<div>
<h2>Slider Syncing (AsNavFor)</h2>
<h4>First Slider</h4>
2019-01-12 03:33:27 +00:00
<Slider asNavFor={this.nav2} ref="slider1">
2018-07-20 08:13:21 +00:00
<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>
<h4>Second Slider</h4>
<Slider
asNavFor={this.nav1}
2019-01-12 03:33:27 +00:00
ref="slider2"
2018-07-20 08:13:21 +00:00
slidesToShow={3}
swipeToSlide={true}
focusOnSelect={true}
>
<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>
2019-01-12 03:33:27 +00:00
);
2018-07-20 08:13:21 +00:00
},
2019-01-12 03:33:27 +00:00
};