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