2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 1
|
2016-07-21 10:10:04 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 不可用
|
|
|
|
en-US: disabled
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-07-16 18:23:25 +08:00
|
|
|
|
2016-07-21 10:10:04 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2015-07-16 18:23:25 +08:00
|
|
|
Radio 不可用。
|
|
|
|
|
2016-07-21 10:10:04 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
Radio unavailable.
|
|
|
|
|
|
|
|
```jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Radio, Button } from 'antd';
|
2015-07-16 18:23:25 +08:00
|
|
|
|
2015-10-28 20:55:49 +08:00
|
|
|
const App = React.createClass({
|
2015-07-16 22:40:49 +08:00
|
|
|
getInitialState() {
|
|
|
|
return {
|
2016-05-11 09:32:33 +08:00
|
|
|
disabled: true,
|
2015-07-16 22:40:49 +08:00
|
|
|
};
|
|
|
|
},
|
|
|
|
toggleDisabled() {
|
|
|
|
this.setState({
|
2016-05-11 09:32:33 +08:00
|
|
|
disabled: !this.state.disabled,
|
2015-07-16 22:40:49 +08:00
|
|
|
});
|
|
|
|
},
|
|
|
|
render() {
|
2016-01-07 16:29:12 +08:00
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<Radio defaultChecked={false} disabled={this.state.disabled}>不可用</Radio>
|
|
|
|
<br />
|
|
|
|
<Radio defaultChecked disabled={this.state.disabled}>不可用</Radio>
|
2016-01-27 16:44:50 +08:00
|
|
|
<div style={{ marginTop: 20 }}>
|
2016-01-07 16:29:12 +08:00
|
|
|
<Button type="primary" onClick={this.toggleDisabled}>
|
|
|
|
Toggle disabled
|
|
|
|
</Button>
|
|
|
|
</div>
|
2015-07-16 22:41:27 +08:00
|
|
|
</div>
|
2016-01-07 16:29:12 +08:00
|
|
|
);
|
2016-05-11 09:32:33 +08:00
|
|
|
},
|
2015-07-16 22:40:49 +08:00
|
|
|
});
|
|
|
|
|
2015-12-29 12:08:58 +08:00
|
|
|
ReactDOM.render(<App />, mountNode);
|
2016-07-21 10:10:04 +08:00
|
|
|
```
|