mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-16 18:09:22 +08:00
43 lines
822 B
Markdown
43 lines
822 B
Markdown
# 不可用
|
|
|
|
- order: 1
|
|
|
|
Radio 不可用。
|
|
|
|
---
|
|
|
|
````jsx
|
|
var Radio = antd.Radio;
|
|
|
|
function toggleDisabled() {
|
|
disabled = !disabled;
|
|
}
|
|
|
|
var App = React.createClass({
|
|
getInitialState() {
|
|
return {
|
|
disabled: true
|
|
};
|
|
},
|
|
toggleDisabled() {
|
|
this.setState({
|
|
disabled: !this.state.disabled
|
|
});
|
|
},
|
|
render() {
|
|
return <div>
|
|
<Radio defaultChecked={false} disabled={this.state.disabled}>不可用</Radio>
|
|
<br />
|
|
<Radio defaultChecked={true} disabled={this.state.disabled}>不可用</Radio>
|
|
<div style={{marginTop: 20}}>
|
|
<button className="ant-btn ant-btn-primary" onClick={this.toggleDisabled}>
|
|
Toggle disabled
|
|
</button>
|
|
</div>
|
|
</div>;
|
|
}
|
|
});
|
|
|
|
React.render(<App />, document.getElementById('components-radio-demo-disable'));
|
|
````
|