div class = " flex-center listing-img " img v- if = " item.imgUrl " v-bind:src= " item.imgUrl " alt= " not find picture " img v- if = " !item.imgUrl " src= " ../../assets/img/detail-not-image.png " alt = " not find picture " v-sf-img/div im
<div class="flex-center listing-img"> <img v-if="item.imgUrl" v-bind:src="item.imgUrl" alt="not find picture"> <img v-if="!item.imgUrl" src="../../assets/img/detail-not-image.png"alt="not find picture" v-sf-img> </div> img1是默认显示图片 .listing-img{
width: 100%; min-height: 270px; max-height: 320px; } .listing-img>img{ display: inline-block; height: auto; max-width: 100%; max-height: 320px; } .flex-center { display: flex; justify-content: center; align-items: center; }