|
@@ -0,0 +1,54 @@
|
|
|
+<script lang="ts" setup>
|
|
|
+import type { TimeLineItemProps } from './type'
|
|
|
+withDefaults(defineProps<TimeLineItemProps>(), {
|
|
|
+ lineColor: '#ccc',
|
|
|
+ circleColor: '#22c30c',
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <view class="timeline-item">
|
|
|
+ <view class="time">时间:{{ time }}</view>
|
|
|
+ <view class="timeline-item-content">
|
|
|
+ <slot></slot>
|
|
|
+ </view>
|
|
|
+ <view class="circle" :style="{ borderColor: circleColor }"></view>
|
|
|
+ <view class="line" :style="{ backgroundColor: lineColor }"></view>
|
|
|
+ </view>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.timeline-item {
|
|
|
+ position: relative;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding-bottom: 60rpx;
|
|
|
+ padding-left: 40rpx;
|
|
|
+ font-size: 28rpx;
|
|
|
+ line-height: 1.6;
|
|
|
+ color: #666;
|
|
|
+ & .circle {
|
|
|
+ position: absolute;
|
|
|
+ top: 10rpx;
|
|
|
+ left: 0;
|
|
|
+ z-index: 1;
|
|
|
+ box-sizing: border-box;
|
|
|
+ width: 20rpx;
|
|
|
+ height: 20rpx;
|
|
|
+ content: '';
|
|
|
+ background-color: #fff;
|
|
|
+ border: 5rpx solid red;
|
|
|
+ border-radius: 50%;
|
|
|
+ }
|
|
|
+ & .line {
|
|
|
+ position: absolute;
|
|
|
+ top: 10rpx;
|
|
|
+ left: 10rpx;
|
|
|
+ z-index: 0;
|
|
|
+ width: 4rpx;
|
|
|
+ height: 100%;
|
|
|
+ content: '';
|
|
|
+ background-color: #ccc;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|