List.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <div class="video-list">
  3. <nuxt-link class="video-list-title" :to="link">
  4. <div class="video-list-title-text">{{ videoCategory.category.name }}</div>
  5. <div class="video-list-title-link">
  6. <div class="button button_video-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="videoCategory.news.length">
  13. <div
  14. class="video-list-item-wrapper"
  15. v-for="item in this.videoCategory.news.slice(0, 15)"
  16. :key="item.id"
  17. >
  18. <VideoItem :item="item"></VideoItem>
  19. </div>
  20. <template #prevArrow="arrowOption">
  21. <button
  22. class="
  23. video-slider-control
  24. 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_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. videoCategory: {
  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: "video-category",
  83. params: {
  84. category: this.videoCategory.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. position: relative;
  98. &-text {
  99. color: #fff;
  100. font-size: 24px;
  101. font-weight: bold;
  102. }
  103. &-link {
  104. margin-left: 15px;
  105. }
  106. }
  107. &-items {
  108. margin-top: 28px;
  109. padding-bottom: 28px;
  110. }
  111. }
  112. ::v-deep .slick {
  113. &-slide {
  114. padding: 0 12px;
  115. }
  116. &-list {
  117. margin: 0 -12px;
  118. }
  119. &-dots {
  120. width: 100%;
  121. position: absolute;
  122. bottom: -28px;
  123. }
  124. }
  125. </style>