|
|
<template>
|
|
|
<div class="focus-image">
|
|
|
<awesome-swiper name="mySwiper" :options="swiperOption" class="swipe">
|
|
|
<div class="swiper-wrapper">
|
|
|
<div class="swiper-wrapper" @click="activeLink">
|
|
|
<div class="swiper-slide"
|
|
|
v-for="focus in value"
|
|
|
:key="focus.src"
|
|
|
:style="{backgroundColor: focus.bgColor}">
|
|
|
<a-link :href="focus.url">
|
|
|
<img-format :src="focus.src" :w="375" :h="240"></img-format>
|
|
|
</a-link>
|
|
|
<img-format :src="focus.src" :w="375" :h="240"></img-format>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="swiper-pagination"></div>
|
|
|
</awesome-swiper>
|
|
|
<a-link ref="linkA" :href="activeHref"></a-link>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
...
|
...
|
@@ -26,6 +25,7 @@ |
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
activeHref: '',
|
|
|
swiperOption: {
|
|
|
loop: true,
|
|
|
autoplay: true,
|
...
|
...
|
@@ -33,6 +33,18 @@ |
|
|
el: '.swiper-pagination'
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
activeLink() {
|
|
|
const img = this.value[this.mySwiper.realIndex];
|
|
|
|
|
|
if (img) {
|
|
|
this.activeHref = img.url;
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.linkA.click();
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
components: {Resource}
|
...
|
...
|
|