BigSwiper.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div class="swiper">
  3. <el-carousel :interval="5000" arrow="always" height="440px" indicator-class="custom-indicator">
  4. <el-carousel-item v-for="item in 5" :key="item">
  5. <img src="../../static/images/image.png" alt="">
  6. <span>高邮市周山镇开展渔业安全生产应急演练...</span>
  7. </el-carousel-item>
  8. </el-carousel>
  9. </div>
  10. </template>
  11. <script setup>
  12. import { ElCarousel, ElCarouselItem } from 'element-plus'
  13. </script>
  14. <style lang="less" scoped>
  15. .swiper {
  16. width: 790px;
  17. height: 440px;
  18. position: relative;
  19. span {
  20. display: inline-block;
  21. width: 790px;
  22. height: 118px;
  23. padding-top: 20px;
  24. padding-left: 23px;
  25. box-sizing: border-box;
  26. position: absolute;
  27. top: 0;
  28. left: 0;
  29. font-family: Source Han Sans, Source Han Sans;
  30. font-weight: 800;
  31. font-size: 24px;
  32. color: #FFFFFF;
  33. background: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
  34. }
  35. }
  36. .el-carousel {
  37. /deep/.el-carousel__arrow i {
  38. font-size: 68px !important;
  39. }
  40. /deep/ .el-carousel__indicators {
  41. // 指示器
  42. left: unset;
  43. transform: unset;
  44. right: 45%;
  45. }
  46. /deep/ .el-carousel__button {
  47. // 指示器按钮
  48. width: 10px;
  49. height: 10px;
  50. border: none;
  51. border-radius: 50%;
  52. border: 1px solid #fff;
  53. background-color:transparent;
  54. }
  55. /deep/ .is-active .el-carousel__button {
  56. // 指示器激活按钮
  57. background: #fff;
  58. }
  59. /deep/ .el-carousel__container {
  60. height: 100%;
  61. }
  62. }
  63. .custom-indicator button {
  64. background-color: #fff;
  65. border: 1px solid #ccc;
  66. opacity: 0.7;
  67. }
  68. .custom-indicator button.is-active {
  69. background-color: #333;
  70. border-color: #333;
  71. opacity: 1;
  72. }
  73. </style>