mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-19 03:54:28 +08:00
48 lines
820 B
Markdown
48 lines
820 B
Markdown
---
|
|
order: 1
|
|
title:
|
|
zh-CN: 不可用
|
|
en-US: disabled
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
Radio 不可用。
|
|
|
|
## en-US
|
|
|
|
Radio unavailable.
|
|
|
|
```__react
|
|
import { Radio, Button } from 'antd';
|
|
|
|
const App = React.createClass({
|
|
getInitialState() {
|
|
return {
|
|
disabled: true,
|
|
};
|
|
},
|
|
toggleDisabled() {
|
|
this.setState({
|
|
disabled: !this.state.disabled,
|
|
});
|
|
},
|
|
render() {
|
|
return (
|
|
<div>
|
|
<Radio defaultChecked={false} disabled={this.state.disabled}>Disabled</Radio>
|
|
<br />
|
|
<Radio defaultChecked disabled={this.state.disabled}>Disabled</Radio>
|
|
<div style={{ marginTop: 20 }}>
|
|
<Button type="primary" onClick={this.toggleDisabled}>
|
|
Toggle disabled
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
);
|
|
},
|
|
});
|
|
|
|
ReactDOM.render(<App />, mountNode);
|
|
```
|