SwiperSnscChannel.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <div class="swiper">
  3. <el-carousel :interval="5000" height="405px" indicator-class="custom-indicator">
  4. <el-carousel-item v-for="(item, index) in data" :key="item">
  5. <NuxtLink class="index_2_left_ul_li_a_text"
  6. :href="getLinkPathDetail(item)"
  7. :title="item.title"
  8. :key="item.id"
  9. :target="item.islink == 1 ? '_blank' : '_self'"
  10. >
  11. <img :src="item.imgurl" title="" alt="item.title">
  12. <span class="swiper_dot1 dot1">
  13. {{index}}{{item.title}}
  14. </span>
  15. </NuxtLink>
  16. </el-carousel-item>
  17. </el-carousel>
  18. </div>
  19. </template>
  20. <script setup>
  21. import { ElCarousel, ElCarouselItem } from 'element-plus'
  22. const props = defineProps({
  23. data: {
  24. type: Array
  25. }
  26. })
  27. </script>
  28. <style lang="less" scoped>
  29. .dot1 {
  30. display: block;
  31. word-break: keep-all;
  32. white-space: nowrap;
  33. overflow: hidden;
  34. text-overflow: ellipsis;
  35. }
  36. .swiper {
  37. width: 100%;
  38. height: 405px;
  39. position: relative;
  40. img {
  41. width: 100%;
  42. height: 405px;
  43. }
  44. .swiper_dot1 {
  45. display: block;
  46. width: 100%;
  47. line-height: 60px;
  48. height: 60px;
  49. color: #fff;
  50. font-size: 24px;
  51. text-indent: 20px;
  52. position: absolute;
  53. bottom: 0;
  54. left: 0;
  55. z-index: 10;
  56. box-sizing: border-box;
  57. padding-right: 244px;
  58. background: linear-gradient(0deg, rgba(0, 0, 0, 0.5) 33%, rgba(0, 0, 0, 0) 100%);
  59. }
  60. }
  61. .el-carousel {
  62. /deep/.el-carousel__arrow i {
  63. font-size: 30px !important;
  64. }
  65. /deep/.el-carousel__arrow--left {
  66. left: 16px;
  67. width: 35px;
  68. height: 57px;
  69. color: #616358;
  70. background: #dcdedc;
  71. position: absolute;
  72. left: 0px;
  73. border: none;
  74. border-radius: 0;
  75. }
  76. /deep/.el-carousel__arrow--right {
  77. right: 16px;
  78. width: 35px;
  79. height: 57px;
  80. color: #616358;
  81. background: #dcdedc;
  82. position: absolute;
  83. right: 0;
  84. border: none;
  85. border-radius: 0;
  86. }
  87. /deep/ .el-carousel__indicators {
  88. // 指示器
  89. left: unset;
  90. transform: unset;
  91. right: 10px;
  92. bottom: 11px;
  93. }
  94. /deep/ .el-carousel__button {
  95. // 指示器按钮
  96. width: 10px;
  97. height: 10px;
  98. border: none;
  99. border-radius: 5px;
  100. background: #fff;
  101. opacity: 1;
  102. }
  103. /deep/ .is-active .el-carousel__button {
  104. // 指示器激活按钮
  105. background: #255590;
  106. width: 25px;
  107. opacity: 1;
  108. }
  109. /deep/ .el-carousel__container {
  110. height: 100%;
  111. }
  112. }
  113. .custom-indicator button {
  114. background-color: #fff;
  115. opacity: 1;
  116. width: 8px;
  117. height: 8px;
  118. }
  119. .custom-indicator button.is-active {
  120. background-color: #DD7D18;
  121. width: 58px;
  122. opacity: 1;
  123. }
  124. </style>