需求要求,合计行不是前端算的,是后端返回的,想要固定在表格最下方
// 行固定
tableRowClassName(row_params) {
let { row } = row_params;
console.log('行固定',row);
if (row.index == '总合计') {
return `tr-fixed fixed-row`;
}else {
return ``;
}
},
/deep/ .el-table{
.tr-fixed{
display: table-row;
position: sticky;
bottom: 0;
width: 100%;
td {
border: 1px solid #f3f5fa;
background: #fff;
}
}
.fixed-row{
bottom: 0;
}
}
别忘了给表格一个高度,要不然看不到效果