TimelineItem.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <script setup lang="ts"></script>
  2. <template>
  3. <li class="van-timeline-item">
  4. <div class="van-timeline-item__tail" />
  5. <div class="van-timeline-item__icon">
  6. <slot name="icon"></slot>
  7. </div>
  8. <div class="van-timeline-item__wrapper">
  9. <slot />
  10. </div>
  11. </li>
  12. </template>
  13. <style scoped lang="less">
  14. .van-timeline-item {
  15. position: relative;
  16. padding-bottom: 20px;
  17. &:last-child {
  18. .van-timeline-item__tail {
  19. display: none;
  20. }
  21. }
  22. .van-timeline-item__tail {
  23. position: absolute;
  24. left: 4px;
  25. height: 100%;
  26. border-left: 2px solid var(--van-border-color);
  27. }
  28. .van-timeline-item__icon {
  29. border-radius: 50%;
  30. border: 1px solid var(--van-border-color);
  31. padding: 0 !important;
  32. background-color: var(--van-background);
  33. color: var(--van-gray-5);
  34. position: absolute;
  35. top: 5.5px;
  36. left: 5px;
  37. height: auto;
  38. width: auto;
  39. margin-top: 0;
  40. line-height: 0;
  41. text-align: center;
  42. transform: translate(-50%, -50%);
  43. }
  44. .van-timeline-item__wrapper {
  45. position: relative;
  46. // padding-left: 28px;
  47. top: -2px;
  48. margin: 0 0 0 26px;
  49. word-break: break-word;
  50. font-size: var(--van-font-size-xs);
  51. }
  52. }
  53. </style>