You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<template>
|
|
|
|
<div class="swiper-container">
|
|
|
|
<div class="swiper-wrapper">
|
|
|
|
<div class="swiper-slide" v-for="(item,index) in ImgNews" :key="index">
|
|
|
|
<div class="rotation-box">
|
|
|
|
<img :src="item.titleUrl" style="height: 340px;width: 100%" alt="" />
|
|
|
|
<div class="rotation-div one-text">
|
|
|
|
{{ item.title }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
import Swiper from 'swiper';
|
|
|
|
import 'swiper/swiper.min.css';
|
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
ImgNews: {
|
|
|
|
type: Array,
|
|
|
|
default: []
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
bannerIndex: 2,
|
|
|
|
};
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
let that = this;
|
|
|
|
/* eslint-disable */
|
|
|
|
let mySwiper = new Swiper('.swiper-container', {
|
|
|
|
loop: true, // 循环模式选项
|
|
|
|
autoplay: true,//自动循环
|
|
|
|
slidesPerView: 3.8, //设置slider容器能够同时显示的slides数量(carousel模式)。
|
|
|
|
spaceBetween: -160, //在slide之间设置距离(单位px)。
|
|
|
|
centeredSlides: true, //设置活动块居中
|
|
|
|
});
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
.swiper-container{
|
|
|
|
width: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.swiper-slide {
|
|
|
|
text-align: center;
|
|
|
|
height: 76%;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
transition: 300ms;
|
|
|
|
transform: scale(0.6);
|
|
|
|
}
|
|
|
|
|
|
|
|
.swiper-slide-active,.swiper-slide-duplicate-active {
|
|
|
|
transform: scale(1);
|
|
|
|
}
|
|
|
|
|
|
|
|
.swiper-slide-next{
|
|
|
|
transform: scale(0.8);
|
|
|
|
z-index: 998 !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.swiper-slide-prev{
|
|
|
|
transform: scale(0.8);
|
|
|
|
}
|
|
|
|
|
|
|
|
.swiper-slide-active {
|
|
|
|
z-index: 999 !important;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rotation-box {
|
|
|
|
position: relative;
|
|
|
|
width: 520px;
|
|
|
|
height: 340px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.rotation-div {
|
|
|
|
position: absolute;
|
|
|
|
bottom: 0;
|
|
|
|
width: 100%;
|
|
|
|
height: 42px;
|
|
|
|
line-height: 42px;
|
|
|
|
background-color: #b61412;
|
|
|
|
color: #fff;
|
|
|
|
font-size: 1.1em;
|
|
|
|
padding: 0 16px;
|
|
|
|
z-index: 10;
|
|
|
|
}
|
|
|
|
</style>
|