小编Bob*_*bek的帖子

React:对变量变化采取行动

有没有办法在变量更改(状态)上调用方法。如何获取哪些组件已更改的列表?

 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)

html css reactjs

5
推荐指数
1
解决办法
2万
查看次数

Material-UI Drawer设置背景色

如何简单地设置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)

javascript reactjs material-ui

5
推荐指数
3
解决办法
8482
查看次数

标签 统计

reactjs ×2

css ×1

html ×1

javascript ×1

material-ui ×1