Element-UI的表格展开的属性 type=“expand” 没有数据的则不显示展开按钮,有数据才会显示

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;
}

文章来源:https://www.jianshu.com/p/c064db86c559?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation

posted @ 2020-03-14 18:40  smil、梵音  阅读(2634)  评论(0编辑  收藏  举报