8. 样式
This commit is contained in:
parent
26cdf763f8
commit
6560620061
@ -6,7 +6,7 @@ export default class SonComponent extends React.PureComponent {
|
||||
state = {
|
||||
msg: "SonComponent Msg",
|
||||
showChildrenBorder: true,
|
||||
childrenClass: [SonComponentCss.children]
|
||||
childrenClass: []
|
||||
}
|
||||
|
||||
// constructor(props) {
|
||||
@ -14,6 +14,10 @@ export default class SonComponent extends React.PureComponent {
|
||||
// console.log(props)
|
||||
// }
|
||||
|
||||
componentDidMount() {
|
||||
this.changeChildrenClass()
|
||||
}
|
||||
|
||||
switchChildrenBorder = () => {
|
||||
this.setState({
|
||||
...this.state,
|
||||
@ -27,7 +31,6 @@ export default class SonComponent extends React.PureComponent {
|
||||
let childrenClass = []
|
||||
if (this.state.showChildrenBorder) {
|
||||
childrenClass = [SonComponentCss.children]
|
||||
|
||||
}
|
||||
|
||||
this.setState({
|
||||
|
Loading…
Reference in New Issue
Block a user