tui-timeaxis-item.vue 832 B

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