afc163
10 years ago
9 changed files with 54 additions and 55 deletions
@ -1,23 +0,0 @@ |
|||
# 基本 |
|||
|
|||
- order: 0 |
|||
|
|||
使用很简单。 |
|||
|
|||
--- |
|||
|
|||
````jsx |
|||
var confirm = antd.confirm; |
|||
|
|||
function showConfirm(){ |
|||
confirm({ |
|||
title: '第一个 confirm', |
|||
content: 'confirm 内容' |
|||
}); |
|||
} |
|||
|
|||
React.render( |
|||
<button className="ant-btn ant-btn-primary" onClick={showConfirm}> |
|||
显示确认框 |
|||
</button>, document.getElementById('components-confirm-demo-basic')); |
|||
```` |
@ -1,25 +0,0 @@ |
|||
# Confirm |
|||
|
|||
- order: 2 |
|||
- category: Components |
|||
- chinese: 确认对话框 |
|||
|
|||
--- |
|||
|
|||
## 何时使用 |
|||
|
|||
当需要用户确认时使用 |
|||
|
|||
|
|||
## api |
|||
|
|||
为一个方法,参数为 object,具体属性如下 |
|||
|
|||
| 参数 | 说明 | 类型 | 默认值 | |
|||
|------------|----------------|------------------|--------------| |
|||
| title | 标题 | React.Element or String | 无 | |
|||
| onOk | 点击确定回调,参数为关闭函数 | function | 无 | |
|||
| onCancel | 取消回调,参数为关闭函数 | function | 无 | |
|||
| width | 宽度 | String or Number | 375 | |
|||
| iconClassName | 图标央样式名 | String | anticon-exclamation-circle | |
|||
|
@ -0,0 +1,27 @@ |
|||
# 确认对话框 |
|||
|
|||
- order: 3 |
|||
|
|||
使用 `confirm()` 可以快捷地弹出确认框。 |
|||
|
|||
--- |
|||
|
|||
````jsx |
|||
var confirm = antd.confirm; |
|||
|
|||
function showConfirm(){ |
|||
confirm({ |
|||
title: '您是否确认要删除这项内容', |
|||
content: '一些解释', |
|||
onOk: function() { |
|||
alert('确定'); |
|||
}, |
|||
onCancel: function() {} |
|||
}); |
|||
} |
|||
|
|||
React.render( |
|||
<button className="ant-btn" onClick={showConfirm}> |
|||
确认对话框 |
|||
</button>, document.getElementById('components-modal-demo-confirm')); |
|||
```` |
Loading…
Reference in new issue