我希望我的抽屉组件在 AppBar 组件下打开,而不是覆盖它。但是对于这个新版本的@Material-Ui/core,这从来没有发生过。
知道我该怎么做吗?
目前,它以一种涵盖 AppBar 的方式打开。这不是我想要的,我希望抽屉在 appBar 组件下打开,就像任何普通应用程序一样。
这是我的代码:
const styles = theme => ({
root: {
flexGrow: 1,
},
flex: {
flex: 1,
},
menuButton: {
marginLeft: -12,
marginRight: 20,
},
list: {
width: 250,
},
});
class ClippedDrawer extends React.Component {
constructor(props){
super(props);
this.state={
open: false,
}
}
toggleDrawer(){
this.setState({
open: !this.state.open,
});
};
render(){
const { classes } = this.props;
return(
<div className={classes.root}>
<AppBar position="relative" className={classes.appBar}>
<Toolbar>
<IconButton className={classes.menuButton} onClick={()=>this.toggleDrawer()} color="inherit" aria-label="Menu">
<MenuIcon />
</IconButton>
<Typography …Run Code Online (Sandbox Code Playgroud)