SwiperNzgx.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. <template>
  2. <div class="swiper">
  3. <!-- 农副产品供销网 -->
  4. <el-carousel :interval="3333" height="405px" indicator-position="none" arrow="always" @change="change_fun">
  5. <el-carousel-item v-for="(item, item_index) in roll_num_lang" :key="item" >
  6. <img class="" src="../../public/img/4.png" title="" alt="">
  7. <span class="swiper_dot1 dot1">
  8. {{ item_index+1}}
  9. 高邮市周山镇开展渔业安全生产应急高邮市周山镇开展渔业安全生产应急高邮市周山镇开展渔业安全生产应急高邮市周山镇开展渔业安全生产应急
  10. </span>
  11. </el-carousel-item>
  12. <div class="roll_num_box">
  13. <span class="roll_num_box_new">{{roll_num_this+1}}</span>
  14. /
  15. {{ roll_num_lang }}
  16. </div>
  17. </el-carousel>
  18. </div>
  19. </template>
  20. <script setup>
  21. import { ElCarousel, ElCarouselItem } from 'element-plus'
  22. import { ref } from 'vue'
  23. const roll_num_lang = ref(4);
  24. const roll_num_this = ref(0);
  25. const change_fun =(the_1)=>{
  26. roll_num_this.value=the_1
  27. }
  28. </script>
  29. <style lang="less" scoped>
  30. .roll_num_box{
  31. position:absolute;z-index:2;left:60px;bottom: 0px;
  32. height:60px;line-height:60px;color:#fff;font-size:16px;
  33. .roll_num_box_new{font-size:20px;}
  34. }
  35. .dot1 {
  36. display: block;
  37. word-break: keep-all;
  38. white-space: nowrap;
  39. overflow: hidden;
  40. text-overflow: ellipsis;
  41. }
  42. .swiper {
  43. width: 100%;
  44. height: 405px;
  45. position: relative;
  46. img {
  47. width: 100%;
  48. height: 405px;
  49. }
  50. .swiper_dot1 {
  51. display: block;
  52. width: 100%;
  53. line-height: 60px;
  54. height: 60px;
  55. color: #fff;
  56. font-size: 18px;
  57. text-indent: 20px;
  58. position: absolute;
  59. bottom: 0;
  60. left: 0;
  61. z-index: 10;
  62. box-sizing: border-box;
  63. padding:0 144px;
  64. background:linear-gradient(0deg,rgba(0,0,0,0.5) 33%,rgba(0,0,0,0) 100%);
  65. }
  66. }
  67. .el-carousel {
  68. /deep/.el-carousel__arrow i {
  69. font-size: 33px !important;
  70. }
  71. .roll_1_box{position:relative;}
  72. /deep/.el-carousel__arrow--left {
  73. position:absolute;
  74. width: 35px;
  75. height: 57px;
  76. color: #fff;
  77. background:rgba(0,0,0,0);
  78. left: 9px;
  79. border: none;
  80. border-radius: 0;
  81. top: 100%;
  82. margin-top:-28px;
  83. }
  84. /deep/.el-carousel__arrow--right {
  85. width: 35px;
  86. height: 57px;
  87. color: #fff;
  88. background:rgba(0,0,0,0);
  89. position: absolute;
  90. right: 9;
  91. border: none;
  92. border-radius: 0;
  93. top: 100%;
  94. margin-top:-28px;
  95. }
  96. /deep/ .el-carousel__indicators {
  97. // 指示器
  98. left: unset;
  99. transform: unset;
  100. right: 10px;
  101. bottom: 11px;
  102. }
  103. /deep/ .el-carousel__button {
  104. // 指示器按钮
  105. width: 10px;
  106. height: 10px;
  107. border: none;
  108. border-radius: 5px;
  109. background: #fff;
  110. opacity: 1;
  111. }
  112. /deep/ .is-active .el-carousel__button {
  113. // 指示器激活按钮
  114. background: #255590;
  115. width: 25px;
  116. opacity: 1;
  117. }
  118. /deep/ .el-carousel__container {
  119. height: 100%;
  120. }
  121. }
  122. .custom-indicator button {
  123. background-color: #fff;
  124. opacity: 1;
  125. width: 8px;
  126. height: 8px;
  127. }
  128. .custom-indicator button.is-active {
  129. background-color: #DD7D18;
  130. width: 58px;
  131. opacity: 1;
  132. }
  133. </style>