我有很多篮球队的副手.因此,当其中一个团队正在盘旋时,我想为每个团队展示不同的东西.此外,我正在使用Reactjs,所以如果我可以有一个变量,我可以传递给另一个很棒的组件.
我已经阅读了:
https://github.com/callemall/material-ui/blob/master/src/styles/getMuiTheme.js
和
http://www.material-ui.com/#/customization/themes
但似乎无法找到我正在寻找的答案。我只是想改变悬停项目的颜色。我相信通过查看这些文档,我应该只参考menuItem并提供一个hoverColor,尽管这不起作用。有什么想法吗?
(不要介意内联 css 覆盖,只是尝试不同的做事方式。)
应用程序
class App extends Component {
constructor(props) {
super(props);
injectTapEventPlugin();
}
render() {
return (
<MuiThemeProvider muiTheme={muiTheme}>
<Router>
<Grid fluid>
<div style={style.navMovement}>
<Route path="/" component={Nav} />
<Switch>
<Route path="/home" component={Home} />
</Switch>
</div>
</Grid>
</Router>
</MuiThemeProvider>
);
}
}
Run Code Online (Sandbox Code Playgroud)
导航
class Nav extends Component {
constructor(props) {
super(props);
}
render() {
return(
<Drawer containerStyle={style.nav}>
<Menu>
<MenuItem
style={{...style.navItem, borderLeft: '2px solid #38a9e3', hoverColor: '#495054' }}
primaryText="Home"
containerElement={<NavLink activeStyle={{color:'#53acff'}} to='/home'></NavLink>} …Run Code Online (Sandbox Code Playgroud) AutoComplete使用Menu来呈现 MenuItems,如这些页面上的文档中所示。
我需要更改悬停菜单项的背景颜色。我可以使用需要样式对象的“menuItemStyle”来更改所有项目的颜色,但我不确定 Material-UI 样式对象中悬停样式的语法是什么。