time-axis.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <view class="time-axis">
  3. <view class="time-axis-item" :style="{width: StyleModel.width, fontSize: StyleModel.fontSize, height: StyleModel.height}">
  4. <view class="time-axis-title">
  5. <slot name="title"></slot>
  6. </view>
  7. <view class="time-axis-content">
  8. <slot name="content"></slot>
  9. </view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. export default {
  15. props: {
  16. StyleModel: {
  17. type: Object,
  18. default: () => ({
  19. fontSize: '26rpx',
  20. color: '#333333',
  21. fontWeight: 400,
  22. width: '616rpx',
  23. height: '244rpx'
  24. })
  25. }
  26. },
  27. data() {
  28. return {}
  29. },
  30. }
  31. </script>
  32. <style lang="scss">
  33. .time-axis {
  34. background-color: #fff;
  35. .time-axis-item {
  36. display: flex;
  37. margin: 0 auto;
  38. border-left: 1px solid #E1E1E1;
  39. align-items: center;
  40. position: relative;
  41. box-sizing: border-box;
  42. padding-left: 30rpx;
  43. .time-axis-title {
  44. position: absolute;
  45. left: 30rpx;
  46. top: 0;
  47. color: #999999;
  48. }
  49. &::before {
  50. content: '';
  51. background-color: #E8E8E8;
  52. width: 28rpx;
  53. height: 28rpx;
  54. border-radius: 50%;
  55. position: absolute;
  56. top: 0;
  57. left: 0;
  58. transform: translate(-50%, 0);
  59. }
  60. &::after {
  61. content: '';
  62. background-color: #999999;
  63. width: 12rpx;
  64. height: 12rpx;
  65. border-radius: 50%;
  66. position: absolute;
  67. top: 0;
  68. left: 0;
  69. transform: translate(-50%, 8rpx);
  70. }
  71. }
  72. }
  73. </style>