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.
|
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
```tsx
|
2022-05-23 14:37:16 +08:00
|
|
|
import { Button, Radio } from 'antd';
|
2022-05-19 09:46:26 +08:00
|
|
|
import React, { useState } from 'react';
|
2015-07-16 18:23:25 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const App: React.FC = () => {
|
|
|
|
const [disabled, setDisabled] = useState(true);
|
2018-06-27 15:55:04 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
const toggleDisabled = () => {
|
|
|
|
setDisabled(!disabled);
|
2019-05-07 14:57:32 +08:00
|
|
|
};
|
2018-06-27 15:55:04 +08:00
|
|
|
|
2022-05-19 09:46:26 +08:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<Radio defaultChecked={false} disabled={disabled}>
|
|
|
|
Disabled
|
|
|
|
</Radio>
|
|
|
|
<Radio defaultChecked disabled={disabled}>
|
|
|
|
Disabled
|
|
|
|
</Radio>
|
|
|
|
<br />
|
|
|
|
<Button type="primary" onClick={toggleDisabled} style={{ marginTop: 16 }}>
|
|
|
|
Toggle disabled
|
|
|
|
</Button>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
2015-07-16 22:40:49 +08:00
|
|
|
|
2022-04-15 16:20:56 +08:00
|
|
|
export default App;
|
2016-07-21 10:10:04 +08:00
|
|
|
```
|