我直接修改el-table的背景颜色,修改之后发现还是原来的白色,所以加入一下代码
/*最外层透明*/
:deep(.el-table),
:deep(.el-table)__expanded-cell {
background-color: transparent !important;
}
/* 表格内背景颜色 */
:deep(.el-table th),
:deep(.el-table tr),
:deep(.el-table td) {
background-color: transparent !important;
}
然后在el-table组件中加入这两行代码,要不然字体也会变透明哦!!!
:cell-style="{ color: '#fff' }"
:header-cell-style="{ color: '#fff' }"