|
本帖最后由 轮了个回 于 2021-1-30 18:13 编辑
- <div><font color="#808080" face="Consolas"><template></font></div><div><font color="#808080" face="Consolas"> <div id="r-homePage"></font></div><div><font color="#808080" face="Consolas"> <swiper :options="swiperOption" ref="mySwiper"></font></div><div><font color="#808080" face="Consolas"> <swiper-slide class="swiper-slide" v-for="ele in picData" :key="ele.id"></font></div><div><font color="#808080" face="Consolas"> <el-image class="sam_wh_100" :src="ele.path ? __imgSrc(ele.path) : ''" fit="cover"></font></div><div><font color="#808080" face="Consolas"> <div slot="placeholder" class="image-slot"></font></div><div><font color="#808080" face="Consolas"> <i class="sam_loading"></i></font></div><div><font color="#808080" face="Consolas"> </div></font></div><div><font color="#808080" face="Consolas"> </el-image></font></div><div><font color="#808080" face="Consolas"> </swiper-slide></font></div><div><font color="#808080" face="Consolas"> <div class="swiper-pagination" slot="pagination"></div></font></div><div><font color="#808080" face="Consolas"> <div class="swiper-button-prev" slot="button-prev"></div></font></div><div><font color="#808080" face="Consolas"> <div class="swiper-button-next" slot="button-next"></div></font></div><div><font color="#808080" face="Consolas"> </swiper></font></div><div><font color="#808080" face="Consolas"> </div></font></div><div><font color="#808080" face="Consolas"></template></font></div><div><font color="#808080" face="Consolas">
- </font></div><div><font color="#808080" face="Consolas"><script></font></div><div><font color="#808080" face="Consolas">export default {</font></div><div><font color="#808080" face="Consolas"> name: "homePage",</font></div><div><font color="#808080" face="Consolas"> data() {</font></div><div><span style="color: rgb(128, 128, 128); font-family: Consolas;"> return {</span></div><div><font color="#808080" face="Consolas"> picData: [],</font></div><div><span style="color: rgb(128, 128, 128); font-family: Consolas;"> swiperOption: {</span></div><div><font color="#808080" face="Consolas"> loop: true,</font></div><div><span style="color: rgb(128, 128, 128); font-family: Consolas;"> autoplay: {</span></div><div><font color="#808080" face="Consolas"> delay: 5000,</font></div><div><font color="#808080" face="Consolas"> stopOnLastSlide: false,</font></div><div><font color="#808080" face="Consolas"> },</font></div><div><font color="#808080" face="Consolas"> // 显示分页</font></div><div><font color="#808080" face="Consolas"> pagination: {</font></div><div><font color="#808080" face="Consolas"> el: ".swiper-pagination",</font></div><div><font color="#808080" face="Consolas"> clickable: true, //允许分页点击跳转</font></div><div><font color="#808080" face="Consolas"> },</font></div><div><font color="#808080" face="Consolas"> // 设置点击箭头</font></div><div><font color="#808080" face="Consolas"> navigation: {</font></div><div><font color="#808080" face="Consolas"> nextEl: ".swiper-button-next",</font></div><div><font color="#808080" face="Consolas"> prevEl: ".swiper-button-prev",</font></div><div><font color="#808080" face="Consolas"> },</font></div><div><font color="#808080" face="Consolas"> },</font></div><div><font color="#808080" face="Consolas"> };</font></div><div><font color="#808080" face="Consolas"> },</font></div><div><font color="#808080" face="Consolas"> methods: {</font><span style="color: rgb(128, 128, 128); font-family: Consolas;">},</span></div><div><font color="#808080" face="Consolas"> computed: {</font></div><div><font color="#808080" face="Consolas"> swiper() {</font></div><div><font color="#808080" face="Consolas"> return this.$refs.mySwiper.swiper;</font></div><div><font color="#808080" face="Consolas"> },</font></div><div><font color="#808080" face="Consolas"> }</font></div><div><font color="#808080" face="Consolas">};</font></div><div><font color="#808080" face="Consolas"></script></font></div>
复制代码
设置了loop: true 也没有效果,导致autoplay也只自动播放一轮就会停止。
|
|