Wrapper.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <template>
  2. <section class="subjects section">
  3. <div class="subjects__wrapper section-wrapper">
  4. <div
  5. class="subjects__background"
  6. :style="'background-image: url(' + imgUrl(module) + ')'"
  7. ></div>
  8. <h2 class="subjects__title">{{ module.title }}</h2>
  9. <div class="subjects__list-wrapper"><client-only>
  10. <VueSlickCarousel
  11. adaptiveHeight
  12. :arrows="false"
  13. class="subjects__list"
  14. :slidesToShow="4"
  15. :slidesToScroll="1"
  16. :infinite="true"
  17. :draggable="false"
  18. :touchMove="false"
  19. :responsive="[{
  20. breakpoint: 1024,
  21. settings: {
  22. draggable: true,
  23. touchMove: true,
  24. slidesToShow: 1,
  25. slidesToShow: 1.
  26. }
  27. }]"
  28. >
  29. <div
  30. class="subjects__item"
  31. v-for="(moduleNews, index) in module.news"
  32. :key="moduleNews.alias"
  33. >
  34. <NewsModuleItem :moduleNews="moduleNews"/>
  35. </div>
  36. </VueSlickCarousel></client-only>
  37. </div>
  38. </div>
  39. </section>
  40. </template>
  41. <script>
  42. import VueSlickCarousel from "vue-slick-carousel";
  43. import "vue-slick-carousel/dist/vue-slick-carousel.css";
  44. import { mapGetters } from "vuex"
  45. export default {
  46. components: {
  47. VueSlickCarousel
  48. },
  49. props: {
  50. module: {
  51. type: Object,
  52. },
  53. },
  54. computed: {
  55. ...mapGetters({
  56. indexNewsList: "modules/news/indexNewsList",
  57. }),
  58. },
  59. methods: {
  60. imgUrl(news) {
  61. return news.image ? news.image.url : '';
  62. },
  63. },
  64. };
  65. </script>
  66. <style lang="less">
  67. .subjects {
  68. margin-top: 30px;
  69. margin-bottom: 30px;
  70. &__item {
  71. margin-right: 30px;
  72. }
  73. &__background {
  74. &::before {
  75. position: absolute;
  76. left: 0;
  77. right: 0;
  78. top: 0;
  79. bottom: 0;
  80. content: '';
  81. background-color: rgb(33, 33, 43);
  82. opacity: .6;
  83. }
  84. }
  85. }
  86. </style>