ant-design-vue/components/vc-slick/demo/AsNavFor.jsx
2019-01-12 12:46:29 +08:00

73 lines
1.3 KiB
Vue

import '../assets/index.less';
import Slider from '../src/slider';
export default {
data() {
return {
nav1: null,
nav2: null,
};
},
mounted() {
this.nav1 = this.$refs.slider1;
this.nav2 = this.$refs.slider2;
},
render() {
return (
<div>
<h2>Slider Syncing (AsNavFor)</h2>
<h4>First Slider</h4>
<Slider asNavFor={this.nav2} ref="slider1">
<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}
ref="slider2"
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>
);
},
};