我使用Material-UI,React
class App extends Component {
constructor() {
super();
this.state = {
drawerOpened: true
};
};
render () {
return(
<div>
<Drawer open={this.state.drawerOpened}>
<div style={{paddingLeft: '256px'}}>
</div>
</div>
我只想在抽屉打开时留下这个填充物(true),关闭抽屉时如何移除填充物?
答案 0 :(得分:0)
<div style={{paddingLeft: this.state.drawerOpened ? '256px' : 'initial'}}>