vue的style方式绑定行内样式-background-image的方式等

转自:https://blog.csdn.net/qq_34664239/article/details/79106570

<tr v-for="(item,index) in dataObj">
   <td class="video-msg" v-bind:id="item.videoid">
   	<div class="videoImg fl" v-bind:style="{
        backgroundImage:'url(' + item.videopic + ')'}">
   	div>
   td>
   <td v-if="item.videoisdel == 3">审核中td>
   <td>{
    {item.publishdate}}td>
   <td>sss
	   	<button class="delete" @click='delConfirm(item.videoid)'>删除button>
   td>

行内样式

v-bind:style="{
     backgroundImage:'url(' + item.videopic + ')', backgroundRepeat:'no-repeat', backgroundPosition:'center center', backgroundSize: 'contain'}"

:style="{
     height: showList && carList.length > 0 ? '23rem' : '0'}"

你可能感兴趣的:(学习,爬坑,vue)