1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
| <!--
| * @Author: 张嘉彬
| * @Date: 2021-09-28 14:42:15
| * @Description:
| -->
| <template>
| <div class="banner-style">
| <swiper ref="mySwiper" :options="swiperOptions" v-if="list.length != 0">
| <swiper-slide v-for="(item, index) in list" :key="index">
| <div class="item" :style="{ backgroundImage: `url(${item})` }"></div>
| </swiper-slide>
| <div class="swiper-pagination" slot="pagination"></div>
| </swiper>
| </div>
| </template>
|
| <script>
| export default {
| name: 'bannerModule',
| props: ['list'],
| data () {
| return {
| swiperOptions: {
| pagination: {
| el: '.swiper-pagination'
| },
| autoplay: {
| delay: 3000,
| disableOninteraction: true
| },
| loop: true
| }
| }
| }
| }
| </script>
|
| <style lang="scss">
| .banner-style{
| .item {
| width: 100%;
| height: 350px;
| background-position: center center;
| background-size: cover;
| background-repeat: no-repeat;
| background-size: 100% 350px;
| }
| }
| </style>
|
|