Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
e07cdf53
A
ant-design
项目概览
wanjj_1210
/
ant-design
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
e07cdf53
编写于
2月 24, 2017
作者:
D
ddcat1115
提交者:
偏右
2月 24, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add left out event parameters for Modal[onOk] Popconfirm[onConfirm] Popconfirm[onCancel] (#5042)
上级
88100a29
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
21 addition
and
19 deletion
+21
-19
components/modal/Modal.tsx
components/modal/Modal.tsx
+3
-3
components/modal/demo/basic.md
components/modal/demo/basic.md
+2
-2
components/modal/index.en-US.md
components/modal/index.en-US.md
+1
-1
components/modal/index.zh-CN.md
components/modal/index.zh-CN.md
+1
-1
components/popconfirm/demo/basic.md
components/popconfirm/demo/basic.md
+4
-2
components/popconfirm/index.en-US.md
components/popconfirm/index.en-US.md
+2
-2
components/popconfirm/index.tsx
components/popconfirm/index.tsx
+6
-6
components/popconfirm/index.zh-CN.md
components/popconfirm/index.zh-CN.md
+2
-2
未找到文件。
components/modal/Modal.tsx
浏览文件 @
e07cdf53
...
...
@@ -17,7 +17,7 @@ export interface ModalProps {
/** 是否显示右上角的关闭按钮*/
closable
?:
boolean
;
/** 点击确定回调*/
onOk
?:
()
=>
void
;
onOk
?:
(
e
:
React
.
MouseEvent
<
any
>
)
=>
void
;
/** 点击模态框右上角叉、取消按钮、Props.maskClosable 值为 true 时的遮罩层或键盘按下 Esc 时的回调*/
onCancel
?:
(
e
:
React
.
MouseEvent
<
any
>
)
=>
void
;
afterClose
?:
()
=>
void
;
...
...
@@ -89,10 +89,10 @@ export default class Modal extends React.Component<ModalProps, any> {
}
}
handleOk
=
()
=>
{
handleOk
=
(
e
)
=>
{
const
onOk
=
this
.
props
.
onOk
;
if
(
onOk
)
{
onOk
();
onOk
(
e
);
}
}
...
...
components/modal/demo/basic.md
浏览文件 @
e07cdf53
...
...
@@ -23,8 +23,8 @@ class App extends React.Component {
visible
:
true
,
});
}
handleOk
=
()
=>
{
console
.
log
(
'
Clicked OK
'
);
handleOk
=
(
e
)
=>
{
console
.
log
(
e
);
this
.
setState
({
visible
:
false
,
});
...
...
components/modal/index.en-US.md
浏览文件 @
e07cdf53
...
...
@@ -22,7 +22,7 @@ and so on.
| confirmLoading | Determine whether to apply loading visual effect for OK button or not | boolean | no |
| title | The modal dialog's title | string
\|
ReactNode | no |
| closable | Determine whether a close (x) button is visible on top right of the modal dialog or not | boolean | true |
| onOk | Specify a function that will be called when a user clicked OK button | function | no |
| onOk | Specify a function that will be called when a user clicked OK button | function
(e)
| no |
| onCancel | Specify a function that will be called when a user clicked mask, close button on top right or cancel button | function(e) | no |
| width | Width of a modal dialog | string
\|
number | 520 |
| footer | Footer content, set as
`footer={null}`
when you don't need default buttons | string
\|
ReactNode | OK and cancel button |
...
...
components/modal/index.zh-CN.md
浏览文件 @
e07cdf53
...
...
@@ -21,7 +21,7 @@ title: Modal
| confirmLoading | 确定按钮 loading | boolean | 无 |
| title | 标题 | string
\|
ReactNode | 无 |
| closable | 是否显示右上角的关闭按钮 | boolean | true |
| onOk | 点击确定回调 | function | 无 |
| onOk | 点击确定回调 | function
(e)
| 无 |
| onCancel | 点击遮罩层或右上角叉或取消按钮的回调 | function(e) | 无 |
| width | 宽度 | string
\|
number | 520 |
| footer | 底部内容,当不需要默认底部按钮时,可以设为
`footer={null}`
| string
\|
ReactNode | 确定取消按钮 |
...
...
components/popconfirm/demo/basic.md
浏览文件 @
e07cdf53
...
...
@@ -16,11 +16,13 @@ The basic example.
````
jsx
import
{
Popconfirm
,
message
}
from
'
antd
'
;
function
confirm
()
{
function
confirm
(
e
)
{
console
.
log
(
e
);
message
.
success
(
'
Click on Yes
'
);
}
function
cancel
()
{
function
cancel
(
e
)
{
console
.
log
(
e
);
message
.
error
(
'
Click on No
'
);
}
...
...
components/popconfirm/index.en-US.md
浏览文件 @
e07cdf53
...
...
@@ -17,8 +17,8 @@ The difference with `confirm` is more lightweight than the static popped full-sc
| Param | Description | Type | Default value |
|-----------|------------------------------------------|---------------|--------|
| title | title of the confirmation box | string
\|
ReactNode | none |
| onConfirm | callback of confirmation | function | none |
| onCancel | callback of cancel | function | none |
| onConfirm | callback of confirmation | function
(e)
| none |
| onCancel | callback of cancel | function
(e)
| none |
| okText | text of the confirmation button | string | Confirm |
| cancelText| text of the cancel button | string | Cancel |
...
...
components/popconfirm/index.tsx
浏览文件 @
e07cdf53
...
...
@@ -6,8 +6,8 @@ import Button from '../button';
export
interface
PopconfirmProps
extends
AbstractTooltipProps
{
title
:
React
.
ReactNode
;
onConfirm
?:
()
=>
void
;
onCancel
?:
()
=>
void
;
onConfirm
?:
(
e
:
React
.
MouseEvent
<
any
>
)
=>
void
;
onCancel
?:
(
e
:
React
.
MouseEvent
<
any
>
)
=>
void
;
okText
?:
React
.
ReactNode
;
cancelText
?:
React
.
ReactNode
;
}
...
...
@@ -46,21 +46,21 @@ export default class Popconfirm extends React.Component<PopconfirmProps, any> {
}
}
confirm
=
()
=>
{
confirm
=
(
e
)
=>
{
this
.
setVisible
(
false
);
const
onConfirm
=
this
.
props
.
onConfirm
;
if
(
onConfirm
)
{
onConfirm
.
call
(
this
);
onConfirm
.
call
(
this
,
e
);
}
}
cancel
=
()
=>
{
cancel
=
(
e
)
=>
{
this
.
setVisible
(
false
);
const
onCancel
=
this
.
props
.
onCancel
;
if
(
onCancel
)
{
onCancel
.
call
(
this
);
onCancel
.
call
(
this
,
e
);
}
}
...
...
components/popconfirm/index.zh-CN.md
浏览文件 @
e07cdf53
...
...
@@ -18,8 +18,8 @@ title: Popconfirm
| 参数 | 说明 | 类型 | 默认值 |
|-----------|------------------------------------------|---------------|--------|
| title | 确认框的描述 | string
\|
ReactNode | 无 |
| onConfirm | 点击确认的回调 | function | 无 |
| onCancel | 点击取消的回调 | function | 无 |
| onConfirm | 点击确认的回调 | function
(e)
| 无 |
| onCancel | 点击取消的回调 | function
(e)
| 无 |
| okText | 确认按钮文字 | string | 确定 |
| cancelText| 取消按钮文字 | string | 取消 |
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录