ant-design/components/button/demo/disabled.md
2019-11-25 07:02:24 +00:00

1.3 KiB

order title
3
zh-CN en-US
不可用状态 Disabled

zh-CN

添加 disabled 属性即可让按钮处于不可用状态,同时按钮样式也会改变。

en-US

To mark a button as disabled, add the disabled property to the Button.

import { Button } from 'antd';

ReactDOM.render(
  <div>
    <Button type="primary">Primary</Button>
    <Button type="primary" disabled>
      Primary(disabled)
    </Button>
    <br />
    <Button>Default</Button>
    <Button disabled>Default(disabled)</Button>
    <br />
    <Button type="dashed">Dashed</Button>
    <Button type="dashed" disabled>
      Dashed(disabled)
    </Button>
    <br />
    <Button type="link">Link</Button>
    <Button type="link" disabled>
      Link(disabled)
    </Button>
    <br />
    <Button type="danger-link">Danger Link</Button>
    <Button type="danger-link" disabled>
      Danger Link(disabled)
    </Button>
    <br />
    <Button type="danger-default">Danger Default</Button>
    <Button type="danger-default" disabled>
      Danger Default(disabled)
    </Button>
    <div style={{ padding: '8px 8px 0 8px', background: 'rgb(190, 200, 200)' }}>
      <Button ghost>Ghost</Button>
      <Button ghost disabled>
        Ghost(disabled)
      </Button>
    </div>
  </div>,
  mountNode,
);