carousel.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <div class="carousel">
  3. </div>
  4. </template>
  5. <script>
  6. export default {
  7. name: 'carousel',
  8. data() {
  9. return {
  10. swiperOption: {
  11. pagination: {
  12. el: '.swiper-pagination',
  13. clickable : true,
  14. bulletClass: 'my-bullet',
  15. bulletActiveClass: 'my-bullet-active'
  16. },
  17. effect:'fade',
  18. autoplay: {
  19. delay: 10000,
  20. disableOnInteraction: true
  21. },
  22. }
  23. }
  24. }
  25. }
  26. </script>
  27. <style lang="less" scoped>
  28. .carousel {
  29. width: 100%;
  30. height: 100%;
  31. position: relative;
  32. .swiper-container {
  33. height: 100%;
  34. .swiper-slide {
  35. background-position: center;
  36. background-repeat: no-repeat;
  37. background-size: cover;
  38. background-attachment: scroll;
  39. height: 100%;
  40. text-align: center;
  41. font-size: 18px;
  42. &:nth-of-type(2) {
  43. background: url('https://file.funcheergame.com/office/image/index/carousel_01.png') center top / cover no-repeat;
  44. }
  45. &:nth-of-type(3) {
  46. background: url('https://file.funcheergame.com/office/image/index/carousel_02.png') center top / cover no-repeat;
  47. }
  48. }
  49. }
  50. }
  51. </style>