You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
128 lines
2.2 KiB
128 lines
2.2 KiB
2 years ago
|
<template>
|
||
|
<div class="t-list f-hflex">
|
||
|
<swiper ref="orderSwiper" :options="swiperOptions">
|
||
|
<swiper-slide
|
||
|
v-for="(item, index) in list"
|
||
|
:key="index"
|
||
|
class="swiper-slide"
|
||
|
>
|
||
|
<div
|
||
|
class="item f-flex bto-border"
|
||
|
@click="handleView(item)"
|
||
|
>
|
||
|
<span>{{ item.createdTime }}</span>
|
||
|
<span>{{ item.eventContent }}</span>
|
||
|
</div>
|
||
|
</swiper-slide>
|
||
|
</swiper>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script>
|
||
|
import {swiper, swiperSlide} from "vue-awesome-swiper";
|
||
|
|
||
|
export default {
|
||
|
name: "DemandSwiperList",
|
||
|
components: {
|
||
|
swiper,
|
||
|
swiperSlide,
|
||
|
},
|
||
|
props: {
|
||
|
list: {
|
||
|
type: Array,
|
||
|
default: () => []
|
||
|
}
|
||
|
},
|
||
|
data() {
|
||
|
return {
|
||
|
swiperOptions: {
|
||
|
direction: "vertical", // 滑动方向,可以是 'horizontal' 或 'vertical'
|
||
|
slidesPerView: 3,
|
||
|
autoplay: {
|
||
|
delay: 1000, // 自动切换的间隔时间,单位是毫秒
|
||
|
disableOnInteraction: true, // 用户操作后是否禁止自动切换
|
||
|
},
|
||
|
loop: true, // 是否启用循环模式
|
||
|
speed: 2000, // 滑动速度,单位是毫秒
|
||
|
},
|
||
|
}
|
||
|
},
|
||
|
mounted() {
|
||
|
|
||
|
},
|
||
|
methods: {
|
||
|
handleView(item) {
|
||
|
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss" scoped>
|
||
|
|
||
|
.f-hflex {
|
||
|
width: 83px;
|
||
|
}
|
||
|
|
||
|
.f-flex {
|
||
|
margin-top: 4px;
|
||
|
}
|
||
|
|
||
|
.f-darkGray {
|
||
|
margin-top: 15px;
|
||
|
}
|
||
|
|
||
|
.no-data {
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
justify-content: center;
|
||
|
opacity: .6;
|
||
|
color: #fff;
|
||
|
}
|
||
|
|
||
|
.t-list {
|
||
|
position: relative;
|
||
|
flex: 1;
|
||
|
width: 100%;
|
||
|
|
||
|
.swiper-container {
|
||
|
width: 100%;
|
||
|
height: 120px;
|
||
|
}
|
||
|
|
||
|
.item {
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
justify-content: space-around;
|
||
|
height: 40px;
|
||
|
cursor: pointer;
|
||
|
color: #fff;
|
||
|
|
||
|
span {
|
||
|
//text-align: center;
|
||
|
}
|
||
|
|
||
|
> :nth-child(1) {
|
||
|
width: 50px;
|
||
|
color: #A3B9DA
|
||
|
}
|
||
|
|
||
|
> :nth-child(2) {
|
||
|
overflow: hidden;
|
||
|
flex: 1;
|
||
|
white-space: nowrap;
|
||
|
text-overflow: ellipsis;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
.swiper-slide {
|
||
|
padding: 0 4px;
|
||
|
//height: 36px!important;
|
||
|
.bto-border {
|
||
|
border-bottom: 1px solid;
|
||
|
border-image: linear-gradient(to right, #1c3e69 0%, #4eafd5 50%, #1c3e69 100%);
|
||
|
border-image-slice: 1;
|
||
|
}
|
||
|
}
|
||
|
</style>
|