<template>
  <div>
    <swiper ref="mySwiper" :options="swiperOptions" loop class="swiperBox">
      <swiper-slide v-for="(item,index) in List" :key="index" class="swiperlibox"><img :src="item.src" /></swiper-slide>
      <!-- 这是下面的分页效果 -->
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
  export default {
    name: "slidingBlock",
    props: {
      List: {
        type: Array,
        default: []
      },
    },
    data() {
      return {
        swiperOptions: {
          slidesPerView: 6,
          autoplay: {
            delay: 3000, //停顿时间
            disableOnInteraction: false,
          },
          loop: true, //无缝轮播
        }
      }
    },
    computed: {
        swiper() {
          return this.$refs.mySwiper.$swiper;
        },
      },
    mounted() {

    },
    methods: {

    }
  }
</script>

<style scoped>

/* 这是最外层的大盒子 */
/* .swiper-container {
  height: 200px;
} */
.swiperBox{
  width: 38vw;
  overflow: hidden;
}
.swiperBox .swiperlibox{
  width: 4vw;
  height: 6vw;
}
.swiperBox .swiperlibox img{
  width: 70%;
}
</style>
