62 lines
1.4 KiB
Vue
62 lines
1.4 KiB
Vue
<template>
|
|
<div class="index-swiper">
|
|
<swiper ref="mySwiper" :options="swiperOptions" class="swiper-outer">
|
|
<swiper-slide class="swiper-box">
|
|
<img src="@/assets/images/banner.png" alt="" class="banner-img">
|
|
</swiper-slide>
|
|
<swiper-slide class="swiper-box">
|
|
<img src="@/assets/images/banner.png" alt="" class="banner-img">
|
|
</swiper-slide>
|
|
<swiper-slide class="swiper-box">
|
|
<img src="@/assets/images/banner.png" alt="" class="banner-img">
|
|
</swiper-slide>
|
|
<div class="swiper-pagination" slot="pagination"></div>
|
|
</swiper>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'IndexSwiper',
|
|
props: {
|
|
bannerList: Array
|
|
},
|
|
data () {
|
|
return {
|
|
swiperOptions: {
|
|
pagination: '.swiper-pagination',
|
|
loop: true,
|
|
autoplay: 3000
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="stylus" rel="stylesheet/stylus" scoped>
|
|
.index-swiper
|
|
width 100%
|
|
min-width 1200px
|
|
height 400px
|
|
position relative
|
|
min-height 375px
|
|
box-sizing border-box
|
|
&:after
|
|
content ''
|
|
display block
|
|
position absolute
|
|
top 0
|
|
left 0
|
|
width 100%
|
|
height 100%
|
|
background url("../../../assets/images/loading.gif") center no-repeat
|
|
z-index -1
|
|
.swiper-outer
|
|
width 100%
|
|
height 100%
|
|
.swiper-box
|
|
.banner-img
|
|
width 100%
|
|
height 100%
|
|
</style>
|