Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
f95b5207a0
Binary file not shown.
|
After Width: | Height: | Size: 1004 B |
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
|
|
@ -0,0 +1,107 @@
|
||||||
|
<template>
|
||||||
|
<!-- 支持高度传参(重要) -->
|
||||||
|
<!-- 把 height 用到容器里: -->
|
||||||
|
<!-- <div class="timeline-container" :style="{ height }"> -->
|
||||||
|
<div class="timeline-container" :style="{ height }">
|
||||||
|
<div class="timeline">
|
||||||
|
<div
|
||||||
|
v-for="(item, index) in list"
|
||||||
|
:key="index"
|
||||||
|
class="timeline-item"
|
||||||
|
>
|
||||||
|
<!-- 时间 -->
|
||||||
|
<div class="time">{{ item.time }}</div>
|
||||||
|
|
||||||
|
<!-- 线 -->
|
||||||
|
<div class="line">
|
||||||
|
<div class="dot" :class="{ active: index === 0 }"></div>
|
||||||
|
<div
|
||||||
|
v-if="index !== list.length - 1"
|
||||||
|
class="vertical-line"
|
||||||
|
></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 内容 -->
|
||||||
|
<div class="content">
|
||||||
|
{{ item.text }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
defineProps({
|
||||||
|
list: {
|
||||||
|
type: Array,
|
||||||
|
default: () => []
|
||||||
|
},
|
||||||
|
height: {
|
||||||
|
type: String,
|
||||||
|
default: '200px'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.timeline-container {
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: rgba(255, 255, 255, 0.8);
|
||||||
|
}
|
||||||
|
|
||||||
|
.timeline-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: flex-start;
|
||||||
|
position: relative;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.time {
|
||||||
|
width: 40px;
|
||||||
|
color: rgba(45, 103, 237, 0.50);
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.line {
|
||||||
|
position: relative;
|
||||||
|
width: 30px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot {
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
background: rgba(45, 103, 237, 0.50);
|
||||||
|
border-radius: 50%;
|
||||||
|
padding: 8px;
|
||||||
|
margin-top: 5px;
|
||||||
|
z-index: 8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dot.active {
|
||||||
|
background: rgba(45, 103, 237, 0.50);
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vertical-line {
|
||||||
|
position: absolute;
|
||||||
|
top: 20px;
|
||||||
|
width: 2px;
|
||||||
|
height: 70%;
|
||||||
|
background: rgba(45, 103, 237, 0.50);
|
||||||
|
}
|
||||||
|
|
||||||
|
.content {
|
||||||
|
flex: 1;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #333;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
max-width: 18em; /* 约等于18个英文字符/接近中文18字宽度 */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue