image-carousel.vue
1.3 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
<template>
<div class="image-carousel">
<swipe :continuous="false" :auto="0" :show-indicators="goods && goods.length > 1">
<swipe-item v-for="item in goods">
<a href="#" title="{{item.title}}">
<img :src="item.colorImage | resize 750 1000" width="100%" alt="">
</a>
</swipe-item>
</swipe>
</div>
</template>
<style l>
.image-carousel {
width: 100%;
height: 1000px;
.swipe {
height: 100%;
}
.swipe-indicators {
left: auto;
right: 32px;
}
.swipe-indicator {
width: 8px;
height: 8px;
line-height: 12px;
display: inline-block;
&.active {
width: 12px;
height: 12px;
background: #000;
opacity: 0.6;
margin: -2px 5px;
}
}
}
</style>
<script>
const swipe = require('yoho-vue-swipe');
require('common/vue-filter');
module.exports = {
props: {
goods: [Object]
},
data() {
return {};
},
components: {
swipe: swipe.Swipe,
swipeItem: swipe.SwipeItem,
}
};
</script>