不平铺的效果: background背景为图片的不平铺的处理: html代码
<div class="my-box-style" :style="{ 'backgroundImage': templateUrl ? 'url('+templateUrl+')' : '' }" >
</div>
css 代码
.my-box-style {
position: relative;
width: 622*$w;
height: 359*$w;
margin: 0 auto;
padding: 32*$w;
background: url('../img/card-bg.png') center center no-repeat;
// background-size 属性表示把 backgroundImage 设置为铺满
background-size: cover;
border-radius: 16*$w;
margin-bottom: 20*$w;
margin-top: 32*$w;
}
最终效果: