|
|
@ -17,27 +17,29 @@ The count will be animated as it changes. |
|
|
|
import { Badge, Button, Icon, Switch } from 'antd'; |
|
|
|
const ButtonGroup = Button.Group; |
|
|
|
|
|
|
|
const Test = React.createClass({ |
|
|
|
getInitialState() { |
|
|
|
return { |
|
|
|
count: 5, |
|
|
|
show: true, |
|
|
|
}; |
|
|
|
}, |
|
|
|
increase() { |
|
|
|
class Demo extends React.Component { |
|
|
|
state = { |
|
|
|
count: 5, |
|
|
|
show: true, |
|
|
|
} |
|
|
|
|
|
|
|
increase = () => { |
|
|
|
const count = this.state.count + 1; |
|
|
|
this.setState({ count }); |
|
|
|
}, |
|
|
|
decline() { |
|
|
|
} |
|
|
|
|
|
|
|
decline = () => { |
|
|
|
let count = this.state.count - 1; |
|
|
|
if (count < 0) { |
|
|
|
count = 0; |
|
|
|
} |
|
|
|
this.setState({ count }); |
|
|
|
}, |
|
|
|
onChange(show) { |
|
|
|
} |
|
|
|
|
|
|
|
onChange = (show) => { |
|
|
|
this.setState({ show }); |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
render() { |
|
|
|
return ( |
|
|
|
<div> |
|
|
@ -62,8 +64,8 @@ const Test = React.createClass({ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
); |
|
|
|
}, |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ReactDOM.render(<Test />, mountNode); |
|
|
|
ReactDOM.render(<Demo />, mountNode); |
|
|
|
```` |
|
|
|