resource-product-list.vue
1.31 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
<template>
<resource>
<ul class="resource-products">
<li class="product-item" v-for="(item, index) in value" :key="index">
<img-format :src="item.default_images" :w="94" :h="125"></img-format>
<p class="brand ellipsis" v-if="item.brand_name">{{item.brand_name}}</p>
<p class="title ellipsis" v-if="item.product_name">{{item.product_name}}</p>
<p class="price ellipsis" v-if="item.sales_price">¥{{item.sales_price}}</p>
</li>
</ul>
</resource>
</template>
<script>
import Resource from './resource';
export default {
name: 'ResourceProductList',
props: {
value: Array
},
computed: {
},
components: {Resource}
};
</script>
<style lang="scss">
.resource-products {
width: 100%;
overflow-x: scroll;
-webkit-overflow-scrolling: touch;
white-space: nowrap;
li.product-item {
display: inline-block;
padding-right: 20px;
text-align: center;
line-height: 40px;
img {
width: 188px;
height: 250px;
}
.ellipsis {
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 28px;
max-width: 188px;
}
}
}
</style>