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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM