有没有办法在变量更改(状态)上调用方法。如何获取哪些组件已更改的列表?
componentDidUpdate(prevProps, prevState) {
const {ID} = this.state
if (this.ID !== this.previousID || this.cmbID !== this.previoudcmbID) {
if(this.ID !== undefined && this.cmbID !== undefined)
{
this.reload3();
// console.log(this.prevProps)
console.log(this.state.settings[0])
console.log(this.prevState.settings[0])
}
}
this.prevState = this.state;
}
Run Code Online (Sandbox Code Playgroud) 如何简单地设置Material-UI Drawer的背景颜色?尝试了这个,但没有用
<Drawer
style={listStyle3}
open={this.state.menuOpened}
docked={false}
onRequestChange={(menuOpened) => this.setState({menuOpened})}
/>
const listStyle3 = {
background: '#fafa00',
backgroundColor: 'red'
}
Run Code Online (Sandbox Code Playgroud)