<template>
  <div class="swiper-container">
    <div class="swiper-wrapper">
      <slot></slot>
    </div>
  </div>
</template>

<script>
import Swiper from 'swiper'
import SwiperCore, { Autoplay, Pagination } from 'swiper/core'

SwiperCore.use([Autoplay, Pagination])

export default {
  name: 'Swiper',
  props: {
    options: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      swiper: undefined
    }
  },
  mounted() {
    this.$nextTick(() => {
      this.swiper = new Swiper(this.$el, this.options)
    })
  }
}
</script>

<style>
.swiper-container {
  width: 100%;
  height: 100%;
}
</style>
