horizontalSlide.vue
2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<template>
<div class="horizontalSlide">
<ul class="list-warp">
<li class="list-item" v-for="(item, index) in value" :key="index">
<ImageFormat
class="image"
src="//img11.static.yhbimg.com/goodsimg/2018/12/28/15/0160a985f0b5999b77436b7af78a85f3df.jpg" alt="加载失败"
:width="136" :height="180"
@error="imageformatError"/>
<div class="info">
<p class="title">Off-White™ x Nike Air Max 90 全新款「Desert Ore」配色曝光 Off-White™ x Nike Air Max 90 全新款「Desert Ore」配色曝光</p>
<div class="bottom">
<span class='icon-ufo'></span>
<span class="price">¥1299</span>
<span class="icon-goumai"></span>
</div>
</div>
</li>
</ul>
</div>
</template>
<script>
export default {
name: 'horizontalSlide',
props: ['value'],
data() {
return {};
},
methods: {
imageformatError() {
console.log(6666);
}
},
computed: {},
components: {}
};
</script>
<style lang="scss" scoped>
.horizontalSlide {
overflow: hidden;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
-webkit-overscroll-behavior-x: contain;
scroll-behavior: smooth;
}
.list-warp {
overflow-x: scroll;
width: max-content;
font-size: 0;
}
.list-item {
display: inline-flex;
width: 600px;
height: 180px;
margin-right: 24px;
border-radius: 8px;
.image {
min-width: 136px;
min-height: 180px;
max-width: 136px;
max-height: 180px;
border-radius: 8px 0 0 8px;
filter: contrast(0.9);
}
.title {
font-size: 24px;
color: #999;
line-height: 34px;
word-break: break-all;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.bottom {
display: flex;
align-items: center;
justify-content: space-between;
}
.info {
padding: 20px;
display: flex;
flex-direction: column;
justify-content: space-between;
border: 1px solid #F0F0F0;
border-radius: 0 8px 8px 0;
}
.price {
margin-left: 16px;
font-size: 28px;
font-family: 'BrownStd-Regular';
vertical-align: middle;
flex: 1 1 auto;
}
.icon-goumai {
float: right;
}
}
</style>