先来看下实现效果
实现效果截图
直接上代码
export default {
name: "TableC",
data() {
return {
tableData: [
{
date: "测试",
name: "测试",
address: "测试"
},
{
date: "测试",
name: "测试",
address: "测试"
},
{
date: "测试",
name: "测试",
address: "测试"
},
{
date: "测试",
name: "测试",
address: "测试"
}
]
};
},
methods: {
getRowClass({ row, column, rowIndex, columnIndex }) {
return "background:#3f5c6d2c;color:#000;";
},
}
};
.table_c {
width: 100%;
height: 500px;
background: url("../../../../assets/images/TestImage/background.jpg") center
center no-repeat;
background-size: 100% auto;
padding: 10px;
}
.tebale_card {
background-color: #3f5c6d2c;
}
.el-table,
.el-table__expanded-cell {
background-color: #3f5c6d2c;
}
除了打开F12去找类名修改,发现修改不完善,又去看文档,找到了设置单独行的属性,然后修改样式后完成上面效果
这里卿洋
愿喜❤️