Vue项目中用到轮播,swiper有专门针对Vue开发的版本。
通过npm安装后,引入文件。
然后写组件,写入后发现,script里面的autoplay参数不起作用了。网上找了都是autoplay:3000(时间自己定)。
有人的电脑上就可以,我的就不可以?
最终用了autoplay:true,轮播自动走了。
你们可以试试这种写法。
export default {
name: 'carrousel',
data() {
return {
// NotNextTick is a component's own property, and if notNextTick is set to true, the component will not instantiate the swiper through NextTick, which means you can get the swiper object the first time (if you need to use the get swipe