You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

820 B

不可用

  • order: 1

Radio 不可用。


import { Radio, Button } from 'antd';

function toggleDisabled() {
  disabled = !disabled;
}

const 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 type="primary" onClick={this.toggleDisabled}>
          Toggle disabled
        </Button>
      </div>
    </div>;
  }
});

ReactDOM.render(<App />, document.getElementById('components-radio-demo-disable'));