8. 样式

This commit is contained in:
shikong 2024-10-26 16:35:29 +08:00
parent 26cdf763f8
commit 6560620061
Signed by: Shikong
GPG Key ID: BD85FF18B373C341

View File

@ -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({