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.
ant-design-vue/components/vc-slick/demo/SlickGoTo.jsx

59 lines
1.2 KiB

import '../assets/index.less'
import Slider from '../src/slider'
import imgList from './imglist'
const {
abstract01, abstract02, abstract03, abstract04,
} = imgList
export default {
data () {
return {
slideIndex: 0,
updateCount: 0,
}
},
render () {
const settings = {
props: {
dots: false,
infinite: true,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1,
afterChange: () => { this.updateCount = this.updateCount + 1 },
beforeChange: (current, next) => { this.slideIndex = next },
},
ref: 'slider',
}
return (
<div>
<h2>Slick Go To</h2>
<p>Total updates: {this.updateCount} </p>
<input
onInput={e => this.$refs.slider.slickGoTo(e.target.value)}
value={this.slideIndex}
type='range'
min={0}
max={3}
/>
<Slider {...settings}>
<div>
<img src={abstract01} />
</div>
<div>
<img src={abstract02} />
</div>
<div>
<img src={abstract03} />
</div>
<div>
<img src={abstract04} />
</div>
</Slider>
</div>
)
},
}