<el-table
:default-expand-all="true"
:row-class-name="getRowClass">
</el-table>
getRowClass:function(row,rowIndex){
if(row.row.childMessageTypeUserRnVos.length==0){ //判断当前行是否有子数据
return 'row-expand-cover'
}
}
css
.row-expand-cover td:last-child .el-icon-arrow-right{visibility: hidden;}

本文介绍如何使用 Element UI 的表格组件实现自定义展开行的样式,并通过 JavaScript 判断是否隐藏箭头图标。当某一行没有子数据时,可以将其设置为特定样式并隐藏默认的展开/收起箭头。
2712

被折叠的 条评论
为什么被折叠?



