<template>
<div class="course">
<div class="time-line" v-for="(item, index) in list" :key="index" :class="!item.show ? 'hidden-time-line' : ''">
<div class="item-border">
<div class="line-item">
<div class="time-div">
<span class="time-span">{{ item.time }}</span>
</div>
<div class="time-con" v-if="item.show">
<p class="title">{{ item.address }}</p>
<p class="doc">{{ item.doc }}}</p>
<img class="line-img" :src="require(`../../../assets/images/about/${item.img}.png`)" alt="">
</div>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'Course',
data() {
return {
list: [
{ show: true, time: '2016年', address: '以鼎 · 北京', doc: '成立技术研发总部,位于北京CBD核心区域', img: 'tec' },
{ show: true, time: '2018年', address: '以鼎 · 上海', doc: '成立大型行业研究及商务中心', img: 'tec' },
{ show: true, time: '2018年', address: '以鼎 · 南通', doc: '成立国家级硬件开发实验室', img: 'tec' },
{ show: true, time: '2018年', address: '以鼎 · 上海', doc: '正式成立,致力于工业互联网及量子物理行业应用', img: 'tec' },
{ show: true, time: '2021年', address: '“以鼎人”仍在创造辉煌', doc: '成立技术研发总部,位于北京CBD核心区域', img: 'tec' },
{ show: false, time: '未来无限可能', address: '', doc: '', img: '' },
]
}
}
}
</script>
<style lang="scss" scoped>
.course {
width: 100%;
padding: 8rem 41rem;
.time-line {
width: 100%;
margin: auto;
height: 32.6rem;
position: relative;
&:nth-child(odd) {
.item-border {
position: absolute;
left: 0;
border-top: 0.1rem solid #1B91FF;
border-right: 0.1rem solid #1B91FF;
.line-item {
.time-div {
position: absolute;
right: -19.25rem;
top: 1.5rem;
}
.time-con {
text-align: right;
}
}
}
}
&:nth-child(even) {
.item-border {
position: absolute;
right: 0;
border-top: 0.1rem solid #1B91FF;
border-left: 0.1rem solid #1B91FF;
.line-item {
position: absolute;
right: 0;
.time-div {
position: absolute;
left: -19.25rem;
top: 1.5rem;
}
.time-con {
text-align: left;
}
}
}
}
.item-border {
width: 55rem;
height: 100%;
.line-item {
width: 43rem;
height: 100%;
background: #F1F1F1;
position: absolute;
top: -3rem;
padding: 2rem 2.9rem;
.time-div {
width: calc(13.5rem + 1.7rem);
height: 3.1rem;
background: #ffffff;
.time-span {
display: inline-block;
width: 13.5rem;
height: 3.1rem;
border-radius: 2rem;
color: #ffffff;
text-align: center;
line-height: 3.1rem;
margin: auto;
background: linear-gradient(90deg, #206cff, #34d1fd);
font-size: 1.8rem;
}
}
.time-con {
.title {
font-size: 2rem;
color: #333333;
font-weight: bold;
}
.doc {
font-size: 1.4rem;
color: #666666;
margin: 1.8rem 0;
}
.line-img {
width: 37rem;
height: 21rem;
border-radius: 1rem;
}
}
}
}
}
.hidden-time-line {
height: 3rem;
& .item-border {
border: none !important;
.line-item {
background: #ffffff;
}
}
}
}
</style>
vue左右两侧时间轴
于 2022-03-16 13:46:52 首次发布