element-ui,Table 表格设置流体高度时,导致操作栏背景变透明

位置:首页 / 技术中心 / 杂项

杂项 Admin 2026-04-23 14:33:44 49

问题根因 :Element-UI 表格设置 max-height 启用虚拟滚动后, fixed="right" 的操作列在某些情况下会出现背景色透明的渲染问题,这是由于固定列和主表格的渲染不同步导致的。

修复方案 :在样式中添加了针对右侧固定列的背景色强制设置:

<style lang="less" scoped>
::v-deep .el-table tr {
    background-color: #fff;
}
::v-deep .el-table__fixed-right {
    background-color: #fff;
}
::v-deep .el-table__fixed-right .el-table__row {
    background-color: #fff !important;
}
::v-deep .el-table__fixed-right .el-table__cell {
    background-color: #fff !important;
}
</style>
18455111359 扫描二维码