소스 검색

自动播放

xiaohaizhao 1 년 전
부모
커밋
3bc6a9febd
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11 1
      components/slideshow.vue

+ 11 - 1
components/slideshow.vue

@@ -3,7 +3,7 @@
         <swiper :style="{
             width: tovw(width),
             height: tovw(height),
-        }">
+        }" :autoplay="autoplay" :interval="interval" circular>
             <swiper-item class="swiper-item" v-for="(item, index) in list" :key="item.list">
                 <u--image @click="onClick(index)" :src="item.cover" :width="tovw(width)" :height="tovw(height)"
                     mode="aspectFill" :lazy-load="true">
@@ -21,6 +21,16 @@ import { viewImage } from "../utils/settleFiles";
 
 export default {
     name: 'slideshow',
+    props: {
+        autoplay: {
+            type: Boolean,
+            default: true
+        },
+        interval: {
+            type: [Number, String],
+            default: 5000
+        }
+    },
     data() {
         return {
             width: 375,