vue dynamic set the background image

backgroundImage needs to be done to determine

 <div class="right-con" :style="{backgroundImage: 'url(' + (coverImgUrl ? coverImgUrl : baseImg) + ')', backgroundSize:'contain'}">
</div>

Directly backgroundImage

 <div class="right-con" :style="{backgroundImage: 'url(' + coverImgUrl + ')', backgroundSize:'contain'}">
</div>

Guess you like

Origin blog.csdn.net/qq_24147051/article/details/94551617