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