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

<script>
import Swiper from 'swiper'

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

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