We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac0770a commit 8c05f03Copy full SHA for 8c05f03
1 file changed
components/dialog/index.js
@@ -63,6 +63,7 @@ Dialog.confirm = ({
63
confirmText = '确定',
64
closable = false,
65
onConfirm = noop,
66
+ onCancel = noop,
67
}) => {
68
const vm = generate({
69
title,
@@ -73,7 +74,11 @@ Dialog.confirm = ({
73
74
btns: [
75
{
76
text: cancelText,
- handler: /* istanbul ignore next */ () => vm.close(),
77
+ handler: /* istanbul ignore next */ () => {
78
+ if (onCancel() !== false) {
79
+ vm.close()
80
+ }
81
+ },
82
},
83
84
text: confirmText,
0 commit comments