<template>
  <div class="simple-swiper">
    <swiper ref="mySwiper" :options="swiperOptions">
      <swiper-slide v-for="(item, index) in imageList" :key="index">
        <div class="slide"><img class="image" :src="item" /></div>
      </swiper-slide>
    </swiper>
  </div>
</template>

<script>
import { Swiper, SwiperSlide, directive } from 'vue-awesome-swiper'
export default {
  components: {
    Swiper,
    SwiperSlide,
  },
  directives: {
    swiper: directive,
  },
  props: {
    imageList: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      swiperOptions: {
        autoplay: true,
      },
    }
  },
  computed: {
    swiper() {
      return this.$refs.mySwiper.$swiper
    },
  },
  mounted() {
    console.log('Current Swiper instance object', this.swiper)
  },
}
</script>

<style scoped lang="scss">
.simple-swiper {
  width: 100%;
  height: 100%;
  overflow: hidden;

  .image {
    display: block;
    width: 100%;
    height: 100%;
  }
}
</style>
