|
|
|
@ -16,17 +16,15 @@ Disabled state of `Switch`.
|
|
|
|
|
````jsx
|
|
|
|
|
import { Switch, Button } from 'antd';
|
|
|
|
|
|
|
|
|
|
const Test = React.createClass({
|
|
|
|
|
getInitialState() {
|
|
|
|
|
return {
|
|
|
|
|
disabled: true,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
toggle() {
|
|
|
|
|
class App extends React.Component {
|
|
|
|
|
state = {
|
|
|
|
|
disabled: true,
|
|
|
|
|
}
|
|
|
|
|
toggle = () => {
|
|
|
|
|
this.setState({
|
|
|
|
|
disabled: !this.state.disabled,
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
@ -35,8 +33,8 @@ const Test = React.createClass({
|
|
|
|
|
<Button type="primary" onClick={this.toggle}>Toggle disabled</Button>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ReactDOM.render(<Test />, mountNode);
|
|
|
|
|
ReactDOM.render(<App />, mountNode);
|
|
|
|
|
````
|
|
|
|
|