Swiper中文论坛
标题:
在nuxt项目中使用swiper,不能实现自动轮播
[打印本页]
作者:
莫小米
时间:
2020-10-17 17:16
标题:
在nuxt项目中使用swiper,不能实现自动轮播
本帖最后由 莫小米 于 2020-10-17 17:17 编辑
在nuxt项目中使用swiper,不能实现自动轮播,这是什么原因呀?大神们求教!!!!!!
作者:
zzz213321
时间:
2020-10-20 15:48
是你的版本太高了吗,我之前项目用的swiper6很多东西用不了,后面降到swiper4就ok了
作者:
山有扶苏-z
时间:
2020-10-28 20:10
<template>
<div class="mySw full" >
<div v-swiper:mySwiper="mobleSwiperOption">
<div class="swiper-wrapper">
<div class="swiper-slide" v-for="(item,index) of getdata.data" :key="index"><swiper :getdata="item" type="small"/></div>
</div>
<div class="swiper-button-next" >
<img src="https://file-skg.skg.com/skg.com/20200914/1f25d1ff02c94280af18900167390d70.png" alt="">
</div>
<div class="swiper-button-prev" >
<img src="https://file-skg.skg.com/skg.com/20200914/c97f34b3a55742e885868a51cf32ff31.png" alt="">
</div>
</div>
</div>
</template>
<script>
import mainsmalldata from "~/static/data/mainsmalldata"
import swiper from '../smallswiperView/smallswiperView.vue'
export default {
name: "smallSwiper",
components: {
swiper
},
data() {
return {
mobleSwiperOption: {
loop: true, // 是否循环轮播
autoplay: {
delay: 2500,
disableOnInteraction: false
},
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
}
},
offsetWidth: 0,
isPC: false,
}
},
props:{
getdata:{
type:Object,
default:()=>mainsmalldata
}
},
methods:{
},
};
</script>
复制代码
作者:
山有扶苏-z
时间:
2020-10-28 20:11
这样是可以的
作者:
Keith
时间:
2020-11-27 12:12
山有扶苏-z 发表于 2020-10-28 20:10
请问一下你用是什么版本的,我用6的,自动轮播、分页器都不能用,只能用loop,我试过你的方法在6也不行
欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/)
Powered by Discuz! X3.2