|
|
<template>
|
|
|
<div class="article-item-slide">
|
|
|
<Slide :data="data.slides" :threshold="0.2" :auto-play="false" :loop="false" :options="scrollOption">
|
|
|
<Slide :data="data.slides" :threshold="0.2" :auto-play="false" :loop="false" :options="scrollOption" @change="onChange">
|
|
|
<SlideItem v-for="(item, inx) in data.slides" :key="inx">
|
|
|
<ImageFormat :lazy="data.index > 0" class="image-slide-item" :src="item.src"></ImageFormat>
|
|
|
</SlideItem>
|
...
|
...
|
@@ -12,6 +12,9 @@ |
|
|
</span>
|
|
|
</template>
|
|
|
</Slide>
|
|
|
<div class="pages">
|
|
|
{{currentIndex}}<span class="small">/{{data.slides.length}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
...
|
...
|
@@ -33,9 +36,13 @@ export default { |
|
|
scrollOption: {
|
|
|
eventPassthrough: 'vertical'
|
|
|
},
|
|
|
currentIndex: 1,
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
onChange(inx) {
|
|
|
this.currentIndex = inx + 1;
|
|
|
},
|
|
|
dotClass(current, inx) {
|
|
|
const offset = 1;
|
|
|
const len = this.data.slides.length;
|
...
|
...
|
@@ -75,6 +82,8 @@ export default { |
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
.article-item-slide {
|
|
|
position: relative;
|
|
|
|
|
|
& /deep/ .cube-slide-dots {
|
|
|
position: absolute;
|
|
|
left: 0;
|
...
|
...
|
@@ -108,4 +117,24 @@ export default { |
|
|
height: 750px;
|
|
|
}
|
|
|
|
|
|
.pages {
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
right: 0;
|
|
|
width: 88px;
|
|
|
height: 54px;
|
|
|
background: rgba($color: #000, $alpha: 0.5);
|
|
|
border-radius: 0 0 0 30px;
|
|
|
color: #fff;
|
|
|
font-size: 28px;
|
|
|
display: flex;
|
|
|
line-height: 24px;
|
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
|
|
|
|
.small {
|
|
|
transform: scale(0.7);
|
|
|
padding-top: 3PX;
|
|
|
}
|
|
|
}
|
|
|
</style> |
...
|
...
|
|