mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-25 08:43:57 +08:00
b83c8636fa
* 📦 enable ESBUILD for site again * re-enable ESBUILD 📦
50 lines
792 B
Markdown
50 lines
792 B
Markdown
---
|
|
order: 1
|
|
title:
|
|
zh-CN: 不可用
|
|
en-US: disabled
|
|
---
|
|
|
|
## zh-CN
|
|
|
|
Radio 不可用。
|
|
|
|
## en-US
|
|
|
|
Radio unavailable.
|
|
|
|
```jsx
|
|
import { Radio, Button } from 'antd';
|
|
|
|
class App extends React.Component {
|
|
state = {
|
|
disabled: true,
|
|
};
|
|
|
|
toggleDisabled = () => {
|
|
this.setState({
|
|
disabled: !this.state.disabled,
|
|
});
|
|
};
|
|
|
|
render() {
|
|
return (
|
|
<>
|
|
<Radio defaultChecked={false} disabled={this.state.disabled}>
|
|
Disabled
|
|
</Radio>
|
|
<Radio defaultChecked disabled={this.state.disabled}>
|
|
Disabled
|
|
</Radio>
|
|
<br />
|
|
<Button type="primary" onClick={this.toggleDisabled} style={{ marginTop: 16 }}>
|
|
Toggle disabled
|
|
</Button>
|
|
</>
|
|
);
|
|
}
|
|
}
|
|
|
|
ReactDOM.render(<App />, mountNode);
|
|
```
|