List.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div class="video-list">
  3. <nuxt-link class="video-list-title" :to="link">
  4. <div class="video-list-title-text">{{ podcast.category.name }}</div>
  5. <div class="video-list-title-link">
  6. <div class="button button_podcast-transparent">
  7. <BaseIcon name="play" />
  8. </div>
  9. </div>
  10. </nuxt-link>
  11. <div class="video-list-items">
  12. <VueSlickCarousel v-bind="settings" v-if="podcast.news.length">
  13. <div
  14. class="video-list-item-wrapper"
  15. v-for="item in this.podcast.news.slice(0, 15)"
  16. :key="item.id"
  17. >
  18. <PodcastItem :item="item"></PodcastItem>
  19. </div>
  20. <template #prevArrow="arrowOption">
  21. <button
  22. class="
  23. video-slider-control
  24. button_podcast-slider button_video-slider button_video-slider-prev
  25. "
  26. >
  27. <BaseIcon name="h-slider-prev" clear />
  28. </button>
  29. </template>
  30. <template #nextArrow="arrowOption">
  31. <button
  32. class="
  33. video-slider-control
  34. button_podcast-slider button_video-slider button_video-slider-next
  35. "
  36. >
  37. <BaseIcon name="h-slider-next" clear />
  38. </button>
  39. </template>
  40. </VueSlickCarousel>
  41. </div>
  42. </div>
  43. </template>
  44. <script>
  45. import VueSlickCarousel from "vue-slick-carousel";
  46. export default {
  47. components: {
  48. VueSlickCarousel,
  49. },
  50. props: {
  51. podcast: {
  52. type: Object,
  53. required: true,
  54. },
  55. },
  56. data: () => ({
  57. settings: {
  58. draggable: true,
  59. dots: true,
  60. arrows: true,
  61. slidesToShow: 3,
  62. slidesToScroll: 3,
  63. responsive: [
  64. {
  65. breakpoint: 900,
  66. settings: {
  67. slidesToShow: 2,
  68. },
  69. },
  70. {
  71. breakpoint: 768,
  72. settings: {
  73. slidesToShow: 1,
  74. },
  75. },
  76. ],
  77. },
  78. }),
  79. computed: {
  80. link() {
  81. return {
  82. name: "podcasts-category",
  83. params: {
  84. category: this.podcast.category.alias,
  85. },
  86. };
  87. },
  88. },
  89. };
  90. </script>
  91. <style lang="less" scoped>
  92. .video-list {
  93. &-title {
  94. display: flex;
  95. align-items: center;
  96. cursor: pointer;
  97. &-text {
  98. color: #000;
  99. font-size: 24px;
  100. font-weight: bold;
  101. }
  102. &-link {
  103. margin-left: 15px;
  104. }
  105. }
  106. &-items {
  107. margin-top: 28px;
  108. padding-bottom: 28px * 2;
  109. }
  110. }
  111. ::v-deep .slick {
  112. &-slide {
  113. padding: 0 12px;
  114. }
  115. &-list {
  116. margin: 0 -12px;
  117. }
  118. &-dots {
  119. width: 100%;
  120. position: absolute;
  121. bottom: -28px;
  122. button {
  123. background-color: #000;
  124. };
  125. .slick-active{
  126. button {
  127. background-color: #000;
  128. };
  129. }
  130. }
  131. }
  132. </style>