插入部分的代码,用的插槽slot配合v-if
当数据为空时展示
<el-table
:data="tableData"
style="width: 100%"
stripe
border
:header-cell-style="{
color: '#333',
fontSize: '14px',
fontWeight: 'bold',
backgroundColor: '#f4f4f4',
}"
:max-height="tableHeight"
ref="table"
>
<div slot="empty" class="color99" style="min-height:80px">
<div v-if="tableData.length==0">
<div class="empty-data-view">
<div>
<span class="empty-text">
<p class="c-title f-14 fw-400"></p>
</span>
</div>
</div>
</div>
</div>
<el-table-column prop="CreateTime" min-width="110" label="申请时间" align="left">
<template slot-scope="scope">
<span> {{$utils.formatTime(scope.row.CreateTime, "yyyy-MM-dd hh:mm:ss")}} </span>
<span> </span>
</template>
</el-table-column>
结果