|
@@ -3,7 +3,7 @@
|
|
|
<swiper ref="swiper" class="relative w-full h-full" :options="swiperOption">
|
|
<swiper ref="swiper" class="relative w-full h-full" :options="swiperOption">
|
|
|
<swiper-slide v-for="(item, index) in items" :key="index">
|
|
<swiper-slide v-for="(item, index) in items" :key="index">
|
|
|
<div class="w-full h-full absolute bg-[rgba(0,0,0,0)]"></div>
|
|
<div class="w-full h-full absolute bg-[rgba(0,0,0,0)]"></div>
|
|
|
- <img class="w-full h-full object-cover" :src="item.bannerUrl" />
|
|
|
|
|
|
|
+ <img class="w-full h-full object-cover" @click="handleGoTo(item)" :src="item.bannerUrl" />
|
|
|
|
|
|
|
|
<div
|
|
<div
|
|
|
:class="`absolute bottom-23rem left-26rem font-normal z-50 flex text-white text-size-20rem ${
|
|
:class="`absolute bottom-23rem left-26rem font-normal z-50 flex text-white text-size-20rem ${
|
|
@@ -32,7 +32,7 @@ import "swiper/swiper-bundle.min.css";
|
|
|
|
|
|
|
|
import SwiperCore, { Autoplay } from "swiper/core";
|
|
import SwiperCore, { Autoplay } from "swiper/core";
|
|
|
SwiperCore.use([Autoplay]);
|
|
SwiperCore.use([Autoplay]);
|
|
|
-
|
|
|
|
|
|
|
+let vm
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
Swiper,
|
|
Swiper,
|
|
@@ -60,6 +60,11 @@ export default {
|
|
|
delay: 2000,
|
|
delay: 2000,
|
|
|
// pauseOnMouseEnter: true,
|
|
// pauseOnMouseEnter: true,
|
|
|
},
|
|
},
|
|
|
|
|
+ on: {
|
|
|
|
|
+ click () {
|
|
|
|
|
+ vm.handleGoTo(vm.items[this.activeIndex])
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}),
|
|
}),
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -70,6 +75,18 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ handleGoTo(item){
|
|
|
|
|
+
|
|
|
|
|
+ if(item.link){
|
|
|
|
|
+
|
|
|
|
|
+ if(item.link.startsWith("http")){
|
|
|
|
|
+ window.open(item.link);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ this.$router.push(item.link);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
change(swiper) {
|
|
change(swiper) {
|
|
|
if (!this.showPagination) return;
|
|
if (!this.showPagination) return;
|
|
|
this.activeIndex = swiper.activeIndex;
|
|
this.activeIndex = swiper.activeIndex;
|
|
@@ -80,6 +97,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.$refs.swiper.$swiper.on("activeIndexChange", this.change);
|
|
this.$refs.swiper.$swiper.on("activeIndexChange", this.change);
|
|
|
|
|
+ vm = this;
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|