table的表头中添加
<el-table :row-class-name="getRowClass"></el-table>
js中添加
// 表格详情没有内容隐藏箭头
getRowClass(row) {
if(row.row.detail.length === 0 || row.row.detail === undefined){ // 即该行没有子元素时,添加row-expand-cover类
return 'row-expand-cover'
}
},
css中添加
.row-expand-cover td .el-table__expand-icon{visibility: hidden;}