carousel.vue 796 B

123456789101112131415161718192021222324252627282930313233343536
  1. <template>
  2. <div class="block">
  3. <span class="demonstration"
  4. >Switch when indicator is hovered (default)</span
  5. >
  6. <el-carousel height="150px">
  7. <el-carousel-item
  8. v-for="(item, idx) in 4"
  9. :key="item"
  10. :style="
  11. idx % 2 === 0
  12. ? {
  13. backgroundColor: '#99a9bf',
  14. }
  15. : {
  16. backgroundColor: '#d3dce6',
  17. }
  18. "
  19. >
  20. <h3
  21. class="small"
  22. style="
  23. color: #475669;
  24. font-size: 14px;
  25. opacity: 0.75;
  26. line-height: 150px;
  27. margin: 0;
  28. text-align: center;
  29. "
  30. >
  31. {{ item }}
  32. </h3>
  33. </el-carousel-item>
  34. </el-carousel>
  35. </div>
  36. </template>