您可以使用sx
解決此問題。
現(xiàn)在我發(fā)現(xiàn)直接在 Tooltip
上使用它不起作用,但您可以使用 slotProps
將其傳遞給實(shí)際的 tooltip
元素屬性。
return ( <Tooltip title={<Typography fontSize={15}>{tip}</Typography>} arrow placement="right" sx={{ fontSize: "30" }} slotProps={{ tooltip: { sx: { color: "#514E6A", backgroundColor: "#ffff", }, }, }} > <IconButton> <HelpOutlineIcon /> </IconButton> </Tooltip> );