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.
|
|
|
|
|
2017-02-13 10:55:53 +08:00
|
|
|
```jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Radio, Button } from 'antd';
|
2015-07-16 18:23:25 +08:00
|
|
|
|
2017-02-20 22:04:17 +08:00
|
|
|
class App extends React.Component {
|
|
|
|
state = {
|
|
|
|
disabled: true,
|
2019-05-07 14:57:32 +08:00
|
|
|
};
|
2018-06-27 15:55:04 +08:00
|
|
|
|
2017-02-20 22:04:17 +08:00
|
|
|
toggleDisabled = () => {
|
2015-07-16 22:40:49 +08:00
|
|
|
this.setState({
|
2016-05-11 09:32:33 +08:00
|
|
|
disabled: !this.state.disabled,
|
2015-07-16 22:40:49 +08:00
|
|
|
});
|
2019-05-07 14:57:32 +08:00
|
|
|
};
|
2018-06-27 15:55:04 +08:00
|
|
|
|
2015-07-16 22:40:49 +08:00
|
|
|
render() {
|
2016-01-07 16:29:12 +08:00
|
|
|
return (
|
2020-03-30 22:14:13 +08:00
|
|
|
<>
|
2019-05-07 14:57:32 +08:00
|
|
|
<Radio defaultChecked={false} disabled={this.state.disabled}>
|
|
|
|
Disabled
|
|
|
|
</Radio>
|
|
|
|
<Radio defaultChecked disabled={this.state.disabled}>
|
|
|
|
Disabled
|
|
|
|
</Radio>
|
2020-06-01 19:29:58 +08:00
|
|
|
<br />
|
|
|
|
<Button type="primary" onClick={this.toggleDisabled} style={{ marginTop: 16 }}>
|
2020-03-30 22:14:13 +08:00
|
|
|
Toggle disabled
|
|
|
|
</Button>
|
|
|
|
</>
|
2016-01-07 16:29:12 +08:00
|
|
|
);
|
2017-02-20 22:04:17 +08:00
|
|
|
}
|
|
|
|
}
|
2015-07-16 22:40:49 +08:00
|
|
|
|
2022-04-03 23:27:45 +08:00
|
|
|
export default () => <App />;
|
2016-07-21 10:10:04 +08:00
|
|
|
```
|