html部分:
<el-table
:row-class-name="getRowClass"
</el-table>
js部分:
getRowClass(row,rowIndex){
if(row.row.tableData.length==0){ //判断当前行是否有子数据或者根据实际情况设置
return ‘row-expand-cover‘
}
}
css部分:
/deep/ .el-table .row-expand-cover .cell .el-table__expand-icon {
display: none;
}
Element-UI的表格展开的属性 type=“expand” 没有数据的则不显示展开按钮,有数据才会显示
原文:https://www.cnblogs.com/smile-fanyin/p/12493512.html