12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <template>
- <view class="u-time-axis-item">
- <slot name="content" />
- <view class="u-time-axis-node" :style="[nodeStyle]">
- <slot name="node"><view class="u-dot"></view></slot>
- </view>
- </view>
- </template>
- <script>
-
- export default {
- name: 'u-time-line-item',
- props: {
-
- bgColor: {
- type: String,
- default: '#ffffff',
- },
-
- nodeTop: {
- type: [String, Number],
- default: '',
- },
- },
- data() {
- return {};
- },
- computed: {
- nodeStyle() {
- let style = {
- backgroundColor: this.bgColor,
- };
- if (this.nodeTop != '') style.top = this.nodeTop + 'rpx';
- return style;
- },
- },
- };
- </script>
- <style lang="scss" scoped>
- .u-time-axis-item {
- display: flex;
- flex-direction: column;
- width: 100%;
- position: relative;
- margin-bottom: 32rpx;
- }
- .u-time-axis-node {
- position: absolute;
- top: 12rpx;
- left: -40rpx;
- transform-origin: 0;
- transform: translateX(-50%);
- display: flex;
- align-items: center;
- justify-content: center;
- z-index: 1;
- font-size: 24rpx;
- }
- .u-dot {
- height: 16rpx;
- width: 16rpx;
- border-radius: 100rpx;
- background: #ddd;
- }
- </style>
|