共1个回答
OI
游客oiHIeZ
可以试试在数据更新后调用组件方法:
<template>
<VueSlickCarousel ref="carousel">
<div><h3>1</h3></div>
/*...*/
</VueSlickCarousel>
<button @click="showNext">show me the next</button>
</template>
<script>
export default {
methods: {
showNext() {
this.$refs.carousel.next()
//或者其他更多方法
//this.$refs.carousel.play()
},
},
}
</script>
参见:https://github.com/gs-shop/vue-slick-carousel/blob/master/docs/API.md#methods