You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
73 lines
1.3 KiB
73 lines
1.3 KiB
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>
|
|
);
|
|
},
|
|
};
|