element Table 根据条件动态添加行样式
鼠标移上去上面显示
选择器:hover{
cursor: pointer;
}
根据条件动态添加行样式
<el-table
v-loading="loading"
:data="deptList"
row-key="deptId"
:row-class-name="tableRowClassNamssse"
highlight-current-row
@current-change="handleCurrentChange"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
//定义的方法
tableRowClassNamssse({ row, rowIndex }) { row.row_index = rowIndex; if(this.currentRow.row_index===rowIndex){ return "tableSelectedRowBgColor"; } return ""; },
.tableSelectedRowBgColor td {
background-color: #80b9ee !important;
cursor: pointer;
}
春有百花秋有月,夏有凉风冬有雪!