1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <template>
  2. <div class="swiper-container">
  3. <div class="swiper-wrapper">
  4. <slot></slot>
  5. </div>
  6. </div>
  7. </template>
  8. <script>
  9. import Swiper from 'swiper'
  10. // import SwiperCore, { Autoplay, Pagination } from 'swiper/core'
  11. // SwiperCore.use([Autoplay, Pagination])
  12. export default {
  13. name: 'Swiper',
  14. props: {
  15. options: {
  16. type: Object,
  17. default: () => ({})
  18. }
  19. },
  20. data() {
  21. return {
  22. swiper: undefined
  23. }
  24. },
  25. mounted() {
  26. this.$nextTick(() => {
  27. this.swiper = new Swiper(this.$el, this.options)
  28. })
  29. }
  30. }
  31. </script>
  32. <style>
  33. .swiper-container {
  34. width: 100%;
  35. height: 100%;
  36. }
  37. </style>