<template>
  <div class="wrapper">
    <swiper show-indicators="false" id="swiper" ref="mySwiper" :options="swiperOptions">
      <swiper-slide v-for="(sowing, index) in sowing_list" :key=sowing.public_id>
        <!-- <img :src="sowing.icon_url" :alt="sowing.public_name"> -->
<!--        <div class="swipper-img-box">轮播{{token}}</div>-->
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
import {Swiper, SwiperSlide, directive} from 'vue-awesome-swiper'
import 'swiper/swiper-bundle.css'
import Swiper2, {Navigation, Pagination, Autoplay} from 'swiper';

Swiper2.use([Navigation, Pagination, Autoplay]);
export default {
  name: "FlashSale",
  props: {
    sowing_list: Array
  },
  data() {
    return {
      swiperOptions: {
        notNextTick: true,
        pagination: { // 分页
          el: '.swiper-pagination',
          clickable: true,
          bulletActiveClass: 'my-swiper-select'
        },
        loop: true, // 循环
        autoplay: {
          delay: 1000,  // 自动播放,切换时长
        },
        speed: 600, // 速度
        direction: 'horizontal',  // 滚动方向
        on: { // 滑动后监听,回调函数
          slideChangeTransitionEnd() {
            //console.log(this.activeIndex);
          }
        }
      },
      token: '',
    }
  },
  mounted() {
    this.token = sessionStorage.getItem('token')
  },
  computed: {
    swiper() {
      return this.$refs.mySwiper.$swiper;
    }
  },
  components: {
    Swiper,
    SwiperSlide
  }
}
</script>

<style scoped>
.swipper-img-box{
  height: 80px;
  background: #f2f2f2;
  text-align: center;
  font-size: 14px;
  padding-top: 30px;
}

.swiper-pagination{
  display: none !important;
}

</style>
