已通过设置height: auto !important;或定义最小高min-height: 80px;图片展示还是无法自适应高度,会遮挡下面div的文字
父组件:
<template>
<div :v-if="filesShow" class="describeFont proofImg">
<imgViewer :files="files"/>
</div>
</template>
<style scoped>
.proofImg{
width: 370px;
height: 150px;
/*height: auto;*/
display: inline-block;
flex-wrap: wrap;
}
.describeFont{
margin-left: 2.2px;
}
</style>
子组件:imgViewer.vue
<template>
<div>
<el-row :gutter="6" class="spacing">
<el-col :span="10" :push="2">
<div class="textStyle">显示已上传图片:</div>
</el-col>
</el-row>
<el-row :gutter="6" class="spacing manyImg">
<el-col :span="20" :push="2">
<div @click.stop class="manyImgShow">
<el-image v-for="(item,index) in files"
:key="index"
:src="fileImgFun(item)"
alt=""
@click="clickHandler"
:preview-src-list="fileImges"
class="showElImg"
>
</el-image>
</div>
</el-col>
</el-row>
</div>
</template>
<style scoped>
.manyImgShow {
height: 80px;
height: auto !important;
}
.showElImg{
/*display: inline-block;*/
width: 50px;
height: 50px;
padding-right: 10px;
}
</style>
求教如何使整个外部的height自适应,不遮挡底部文字?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…