你好,我遇到了一个问题,我无法覆盖在选择菜单项时显示正确样式的类:这是我的代码:
<MenuItem component={Link} to="/Acceuil"
className={{root:classes.menuItem ,selected:classes.selected}}
selected={pathname === "/Acceuil"} >
<ListItemIcon>
<Icon className={classes.icon} >
insert_drive_file
</Icon>
</ListItemIcon>
Gestion Commandes
</MenuItem>
这是类 const :
Const classes = theme => ({
menuItem: {
fontStyle:'bold',
backgroundColor: 'white',
width: '88%',
'&:active':{
borderLeft: '4px solid #51bcda',
backgroundColor: "-webkit-box-shadow: 6px 4px 53px -7px
rgba(0,0,0,0.75), -moz-box-shadow: 6px 4px 53px -7px
rgba(0,0,0,0.75), box-shadow: 6px 4px 53px -7px
rgba(0,0,0,0.75),",
},
selected:{
backgroundColor:'red !important'
}
});
谢谢你帮助我^^