<template>
<el-table border v-loading="loading" element-loading-text="列表加载中..." height="50vh"
:data="sickBedsList" :row-class-name="rowStyle" class="tables" highlight-current-row
ref="table" @row-click="rowClick">
<el-table-column type="expand">
<template slot-scope="props">
<el-table border :header-cell-style="setTitle" v-loading="loading"
element-loading-text="列表加载中..." height="auto"
:data="props.row.pcaPatientList" stripe class="tables" highlight-current-row
ref="table" @row-click="rowClick">
<el-table-column type="index" :index="indexMenthod" label="序号"
width="100" align="center"></el-table-column>
</el-table>
</template>
</el-table-column>
</el-table>
</template>
<script>
export default{
data() {},
methods: {
// 根据条件行显示颜色
rowStyle({ row, rowIndex }) {
if (row.pcaPatientList.length > 0) {
return 'success_class';
}
},
}
}
</script>
<style scoped>
>>>.el-table .success_class {
background: rgb(245, 253, 230);
}
</style>
注意:row-class-name属性和stripe属性一起使用,不起效果。所以删除stripe属性,效果生效如下: