SwiperSnscShopInfoCateg.vue 2.8 KB

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