ant-design/components/radio/demo/disabled.md
2022-05-21 22:14:15 +08:00

720 B

order title
1
zh-CN en-US
不可用 disabled

zh-CN

Radio 不可用。

en-US

Radio unavailable.

import { Button, Radio } from 'antd';
import React, { useState } from 'react';

const App: React.FC = () => {
  const [disabled, setDisabled] = useState(true);

  const toggleDisabled = () => {
    setDisabled(!disabled);
  };

  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>
    </>
  );
};

export default App;