ant-design/components/button/demo/disabled.md

31 lines
678 B
Markdown
Raw Normal View History

2015-10-30 17:00:06 +08:00
# 不可用
2015-06-17 18:22:20 +08:00
- order: 3
2015-10-30 17:00:06 +08:00
添加 `disabled` 属性即可让按钮处于不可用状态,同时按钮样式也会改变。
---
2015-09-27 16:30:35 +08:00
````jsx
import { Button } from 'antd';
2015-09-27 16:30:35 +08:00
2015-10-20 16:47:55 +08:00
ReactDOM.render(<div>
2015-09-27 16:30:35 +08:00
<Button type="primary">主按钮</Button>
<Button type="primary" disabled>主按钮(失效)</Button>
<br />
<Button>次按钮</Button>
<Button disabled>次按钮(失效)</Button>
<br />
<Button type="ghost">幽灵按钮</Button>
2015-10-30 17:00:06 +08:00
<Button type="ghost" disabled>幽灵按钮(失效)</Button>
2015-09-27 16:30:35 +08:00
</div>
2015-10-30 17:00:06 +08:00
, document.getElementById('components-button-demo-disabled'));
````
2015-09-27 16:30:35 +08:00
<style>
2015-10-30 17:00:06 +08:00
#components-button-demo-disabled .ant-btn {
2015-09-27 16:30:35 +08:00
margin-right: 8px;
margin-bottom: 12px;
}
</style>