index.vue 901 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <swiper class="swiper simple-swiper" :options="swiperOption">
  3. <swiper-slide v-for="(item, index) in imageList" :key="index">
  4. <img :src="item" class="slide" />
  5. </swiper-slide>
  6. <div class="swiper-pagination" slot="pagination"></div>
  7. </swiper>
  8. </template>
  9. <script>
  10. import { Swiper, SwiperSlide } from 'vue-awesome-swiper'
  11. export default {
  12. name: 'simple-swiper',
  13. components: {
  14. Swiper,
  15. SwiperSlide,
  16. },
  17. props: {
  18. imageList: {
  19. type: Array,
  20. default: () => [],
  21. },
  22. },
  23. data() {
  24. return {
  25. swiperOption: {
  26. pagination: {
  27. el: '.swiper-pagination',
  28. clickable: true,
  29. },
  30. autoplay: true,
  31. },
  32. }
  33. },
  34. }
  35. </script>
  36. <style scoped lang="scss">
  37. .simple-swiper {
  38. height: 100%;
  39. ::v-deep {
  40. .swiper-pagination-bullet-active {
  41. background: #535353 !important;
  42. }
  43. }
  44. }
  45. </style>