我试图在取消选择行时将行的颜色更改为不同的颜色。这个功能是primeng主题提供的。我正在尝试覆盖它来自定义它。无论如何,我可以在取消选择行时更改行颜色,然后保留该颜色直到再次选择该行吗?我在这里使用单选 p 表。
我尝试用这个来覆盖:
data-table p-table .ui-table.ui-table-hoverable-rows .ui-table-tbody > tr.ui-selectable-row:not(.ui-state-highlight):not(.ui-contextmenu-selected):hover {
background-color: #2F96B4 !important;
}
Run Code Online (Sandbox Code Playgroud)
但这只会改变鼠标悬停时的颜色。
这就是选择行时我所要做的:
data-table p-table .ui-table .ui-table-tbody > tr.ui-state-highlight {
background-color: #007ad9;
color: #ffffff;
}
Run Code Online (Sandbox Code Playgroud)