我很高兴今天提出我的第一个问题 :) 如何使用 Vue-Carousel 在点击元素上滑动?我想通过单击我的输入来触发右侧的幻灯片。这是我基于文档的代码:
< carousel id = " demo_carousel " > <slide class=" slides_demo " > <i nput type=" button " @click="getNextPage()" value=" Go " / > < /slide> < slide class=" slides_demo " > < p>This is next page</p > < /slide > < /carousel >
这是我的功能:
methods: { getNextPage:function() { if (this.currentPage < this.pageCount - 1) { return this.currentPage + 1; } return this.loop ? 0 : this.currentPage; } }
但滑动不会触发。我做错了什么?我应该创建自己的函数吗?Vue-Carousel 文档:( https://github.com/SSENSE/vue-carousel )感谢帮助 :)
This is next page