Carousel.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div class="carousel">
  3. <div class="container">
  4. <p>已入驻商家,您也来加入吧!</p>
  5. <div v-swiper:mySwiper="swiperOption">
  6. <div class="swiper-wrapper">
  7. <div class="swiper-slide" v-for="banner in banners">
  8. <a href="#">
  9. <img :src="banner">
  10. </a>
  11. </div>
  12. </div>
  13. <div class="swiper-pagination swiper-pagination-bullets"></div>
  14. </div>
  15. </div>
  16. </div>
  17. </template>
  18. <script>
  19. export default {
  20. name: 'carousel',
  21. data () {
  22. return {
  23. banners: [
  24. '../img/ktv.jpg',
  25. '../img/ktv.jpg',
  26. '../img/ktv.jpg',
  27. '../img/ktv.jpg',
  28. '../img/ktv.jpg',
  29. '../img/ktv.jpg',
  30. '../img/ktv.jpg',
  31. '../img/ktv.jpg',
  32. '../img/ktv.jpg',
  33. '../img/ktv.jpg',
  34. '../img/ktv.jpg'
  35. ],
  36. swiperOption: {
  37. autoplay: {
  38. delay: 2000,
  39. disableOnInteraction: false
  40. },
  41. loop: true,
  42. lazyLoading: true,
  43. centeredSlides: true,
  44. mousewheel: true,
  45. slidesPerView: 5,
  46. pagination: {
  47. // el: '.swiper-pagination',
  48. // dynamicBullets: true,
  49. // clickable: true
  50. }
  51. }
  52. }
  53. },
  54. mounted () {
  55. }
  56. }
  57. </script>
  58. <style scoped type="text/scss" lang="scss">
  59. .carousel{
  60. background: #fae7ee;
  61. height:236px;
  62. padding-top:35px;
  63. .container{
  64. text-align: center;
  65. p{
  66. font-size: 24px;
  67. margin-bottom:40px;
  68. }
  69. img{
  70. width:100px;
  71. height:100px;
  72. border-radius:50%;
  73. }
  74. }
  75. }
  76. </style>