0
点赞
收藏
分享

微信扫一扫

element-plus table tableRowClassName 无效

野见 2024-11-07 阅读 11

官网上给的是

.el-table .warning-row {
  --el-table-tr-bg-color: var(--el-color-warning-light-9);
}
.el-table .success-row {
  --el-table-tr-bg-color: var(--el-color-success-light-9);
}

但是  如果 加上了  scoped  这样样式是无效的  

在 vue3  中用样式穿透 即可生效  不用去掉 scoped 

<style lang="scss" scoped>
    :deep(.el-table .warning-row) {
      --el-table-tr-bg-color: var(--el-color-warning-light-9);
    }

    :deep(.el-table .success-row) {
      --el-table-tr-bg-color: #a5f8c9;
    }
<style/>
举报

相关推荐

0 条评论