8. 样式
This commit is contained in:
parent
dc03a66560
commit
26cdf763f8
@ -18,23 +18,22 @@ export default class SonComponent extends React.PureComponent {
|
||||
this.setState({
|
||||
...this.state,
|
||||
showChildrenBorder: !this.state.showChildrenBorder
|
||||
}, (state)=>{
|
||||
}, ()=>{
|
||||
this.changeChildrenClass()
|
||||
})
|
||||
}
|
||||
|
||||
changeChildrenClass = () => {
|
||||
if(this.state.showChildrenBorder){
|
||||
this.setState({
|
||||
...this.state,
|
||||
childrenClass:[SonComponentCss.children]
|
||||
})
|
||||
} else {
|
||||
this.setState({
|
||||
...this.state,
|
||||
childrenClass:[]
|
||||
})
|
||||
let childrenClass = []
|
||||
if (this.state.showChildrenBorder) {
|
||||
childrenClass = [SonComponentCss.children]
|
||||
|
||||
}
|
||||
|
||||
this.setState({
|
||||
...this.state,
|
||||
childrenClass
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
|
Loading…
Reference in New Issue
Block a user