出现画廊图片不居中的情况,<swiper>未撑满整个div
来源:9-2 Vue项目详情页 - 公用图片画廊组件拆分
慕的地2446357
2018-06-08
如下图所示

代码:
<template>
<div class="container">
<div class="wrapper">
<swiper>
<swiper-slide>
<img class="gallary-img" src="//img1.qunarzz.com/sight/p0/1412/be/c788f0f3767d2ea037b9b66d2010bfa4.water.jpg_r_800x800_2ddc6f15.jpg" />
</swiper-slide>
<!-- <div class="swiper-pagination" slot="pagination"></div> -->
</swiper>
</div>
</div>
</template>
<script>
export default {
name: 'CommonGallary'
}
</script>
<style socped>
.container
display: flex
flex-direction: column
justify-content: center
z-index: 99
position: fixed
left: 0
right: 0
top: 0
bottom: 0
background: #000
.wrapper
overflow: hidden
height: 0
width: 100%
padding-bottom: 100%
.gallary-img
width: 100%
</style>
1回答
-
慕的地2446357
提问者
2018-06-08
初步看了一下是由于选用的图片宽高不相等导致的,应该如何解决呢?
022020-03-10
相似问题