timeaxis-item.vue 851 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <template>
  2. <view class="timeaxis-item-class tui-timeaxis-item">
  3. <slot name="content"></slot>
  4. <view class="tui-node" :style="{background:bgcolor}">
  5. <slot name="node"></slot>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. export default {
  11. name: "tuiTimeaxisItem",
  12. props: {
  13. //节点背景色
  14. bgcolor: {
  15. type: String,
  16. default: "#fafafa"
  17. }
  18. },
  19. data() {
  20. return {
  21. };
  22. }
  23. }
  24. </script>
  25. <style>
  26. .tui-timeaxis-item {
  27. position: relative;
  28. width: 100%;
  29. display: flex;
  30. justify-content: center;
  31. flex-direction: column;
  32. margin-bottom: 25px;
  33. }
  34. .tui-node {
  35. position: absolute;
  36. top: 0;
  37. left: -20px;
  38. /* padding: 3px 0; */
  39. transform-origin: 0;
  40. transform: translateX(-50%);
  41. display: flex;
  42. align-items: center;
  43. justify-content: center;
  44. z-index: 99;
  45. background: #fafafa;
  46. font-size: 24upx;
  47. }
  48. </style>