原因:组件的样式为如下,导致该类名.table-striped未被正确赋予给组件

[data-doc-theme='light'] .ant-table-striped :deep(.table-striped) td { background-color: #fafafa; } [data-doc-theme='dark'] .ant-table-striped :deep(.table-striped) td { background-color: rgb(29, 29, 29); }
解决方法:删除前缀,修改后代码如下
修改为:
:[data-doc-theme='light'] .ant-table-striped :deep(.table-striped) td{background-color: #fafafa;}
[data-doc-theme='dark'] .ant-table-striped :deep .table-striped td{background-color:rgb(29, 29, 29);}
文章讨论了在使用Ant-Table时,`.table-striped`类在不同主题(light/dark)下未能正确应用的问题,解决办法是移除前缀并调整CSS代码。
1598

被折叠的 条评论
为什么被折叠?



