遇见
5 years ago
5 changed files with 74 additions and 1 deletions
@ -0,0 +1,53 @@
@@ -0,0 +1,53 @@
|
||||
<template> |
||||
<div class="wrapper"> |
||||
<swiper :options="swiperOption"> |
||||
<!-- slides --> |
||||
<swiper-slide v-for="item of swiperList" v-bind:key="item.id"> |
||||
<img class="Swiper-img" v-bind:src="item.imgUrl" /> |
||||
</swiper-slide> |
||||
<!-- Optional controls --> |
||||
<div class="swiper-pagination" slot="pagination"></div> |
||||
<!-- <div class="swiper-scrollbar" slot="scrollbar"></div> --> |
||||
</swiper> |
||||
</div> |
||||
</template> |
||||
|
||||
<script> |
||||
export default { |
||||
name: "HomeSwiper", |
||||
data: function() { |
||||
return { |
||||
swiperOption: { |
||||
pagination: ".swiper-pagination", |
||||
loop: true |
||||
}, |
||||
swiperList: [ |
||||
{ |
||||
id: "0001", |
||||
imgUrl: |
||||
"http://img1.qunarzz.com/sight/p0/1508/80/29eaf59b380bef97acacba8a8f6efd2a.water.jpg_600x330_76f8cfee.jpg" |
||||
}, |
||||
{ |
||||
id: "0002", |
||||
imgUrl: |
||||
"http://img1.qunarzz.com/sight/p0/1505/73/73b2d79cae228337.water.jpg_600x330_edecfc9c.jpg" |
||||
} |
||||
] |
||||
}; |
||||
} |
||||
}; |
||||
</script> |
||||
|
||||
<style lang="stylus" scoped> |
||||
.wrapper >>> .swiper-pagination-bullet-active |
||||
background #ffffff !important |
||||
.wrapper |
||||
overflow hidden |
||||
width 100% |
||||
height 0 |
||||
padding-bottom 28.1% |
||||
background #eeeeee |
||||
.Swiper-img |
||||
width 100% |
||||
height 2.34rem |
||||
</style> |
Reference in new issue