
template:
<el-table v-loading="loading" :data="orderList" ref="multipleTableTree" row-key="id" :key="treeKey" :tree-props="{ children: 'purchaseProductList' }"
@selection-change="handleSelectionChange" :row-class-name="tableRowClassName" :cell-class-name="cellNone"
:default-expand-all="expandSwitch" style="width:100%">
metheds:
handleSwitch(){
this.treeKey = + new Date()
this.expandSwitch = !this.expandSwitch
},
tableRowClassName({row,rowIndex}){
if(row.isUrgent==1){
return 'warning-row';
}
return '';
},
cellNone(row){
if (row.row.level == 2) { return "checkNone";}
},
styles:
::v-deep .checkNone .el-checkbox__input {display: none}
::v-deep .warning-row {background: oldlace;}
.orderNoRelative{position:relative;}
::v-deep .el-table__expand-icon{position:absolute;left:0;margin-left:-14px;margin-top:2px;}

本文介绍了如何在Vue项目中使用ElementUI的el-table组件实现数据的动态加载,并展示了如何自定义行高亮和单元格样式,以及如何通过方法控制展开状态。

1997

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



