我想通过header.multipleRow
去控制是否是自定义的,但是没用,后来又在外面包裹一层也不行~
我感觉是slot-scope
不能用v-if
去控制的原因
<el-table-column v-for="(header, index) of tableHeaders" :sortable="header.sortable" :type="header.type" :prop="header.prop" :label="header.label" :width="header.width" :key="index">
<div slot-scope="scope" v-if="header.multipleRow">
<div class="biz-customcol">
<img :src="scope.row[header.prop].img" alt="">
<div class="biz-two-row">
<span style="margin-left: 10px">{{ scope.row[header.prop].value1 }}</span>
<span style="margin-left: 10px">{{ scope.row[header.prop].value2 }}</span>
</div>
</div>
</div>
</el-table-column>
<el-table-column v-for="(header, index) of tableHeaders" :sortable="header.sortable" :type="header.type" :prop="header.prop" :label="header.label" :width="header.width" :key="index">
<div v-if="header.multipleRow">
<div slot-scope="scope">
<div class="biz-customcol">
<img :src="scope.row[header.prop].img" alt="">
<div class="biz-two-row">
<span style="margin-left: 10px">{{ scope.row[header.prop].value1 }}</span>
<span style="margin-left: 10px">{{ scope.row[header.prop].value2 }}</span>
</div>
</div>
</div>
</div>
</el-table-column>
写在template里面把
<el-table v-for="(header, index) of tableHeaders" >
</el-table>