product-group.vue
1.11 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
<template>
<div class="product-group">
<ProductGroupItem
v-for="(product, inx) in data"
:share="share"
:thumb="thumb"
:single="single"
:product="product"
:article-id="articleId"
:pos-id="posId"
:lazy="lazy"
:index="index"
:key="inx">
</ProductGroupItem>
</div>
</template>
<script>
import ProductGroupItem from './product-group-item';
import {Button} from 'cube-ui';
export default {
name: 'ProductGroup',
props: {
data: {
type: Array,
default() {
return [];
}
},
lazy: {
type: Boolean,
default: true
},
articleId: {
type: [String, Number],
},
share: Boolean,
thumb: Boolean,
posId: Number,
index: Number
},
computed: {
single() {
return this.data.length === 1;
},
},
components: {Button, ProductGroupItem}
};
</script>
<style lang="scss" scoped>
.product-group {
width: 100%;
overflow-x: auto;
overflow-y: hidden;
height: 276px;
padding-top: 40px;
padding-bottom: 40px;
white-space: nowrap;
-webkit-overflow-scrolling: touch;
}
</style>