当房产是真实的时候如何改变风格"

时间:2017-08-14 16:37:11

标签: javascript html css reactjs material

我使用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),关闭抽屉时如何移除填充物?

1 个答案:

答案 0 :(得分:0)

<div style={{paddingLeft: this.state.drawerOpened ? '256px' : 'initial'}}>