如何更改悬停的表行背景颜色或鼠标材料ui datatable中的鼠标

问题描述 投票:0回答:0
非常新的反应和材料。 当指针 /鼠标被移到行上时,即在悬停。

我尝试了其他帖子中的“解决方案”,但没有成功。 (例如,根和细胞和大小写)

xx.js

export const xxTheme = createTheme({ typography: { fontFamily: 'xxText', fontSize: 11, }, tableRow: { "&$hover:hover": { backgroundColor: "blue" } }, tableCell: { "$hover:hover &": { color: "pink" } }, hover: {}, overrides: { MuiTableCell: { root:{ color: xxColors.grey2, '& .MuiCheckbox': { color: xxColors.grey2, }, "&$hover:hover" : { backgroundColor: "blue" } }, head: {...} tableRow: { "&$hover:hover": { backgroundColor: "cyan" } }, },

在xxtabledoby.js

import {Table, TableContainer} from "@material-ui/core";
import {Checkbox, TableBody, TableCell, TableRow} from "@material-ui/core";
import {xxColors} from "../styles/xx";

<TableRow
    key={step.workStepId}
    ref={dragProvided.innerRef}
    selected={isItemSelected}
    aria-checked={isItemSelected}
    {...dragProvided.draggableProps}

    classes={{'hover':{color:'#7EA55FF'}}}
    style={{
          ...dragProvided.draggableProps.style,
          background: snapshot.isDragging   ? xxColors.blue1 : "none",
          }}
    >
   <TableCell key={'drag'} align={'left'}>
       <div {...dragProvided.dragHandleProps}>
           <ReorderIcon/>
       </div>
   </TableCell>

需要什么需要/修复?

tia
    

通过删除JSS条件“快照。

reactjs material-ui mousehover
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.