diff --git a/components/notification/demo/with-btn-onclose.md b/components/notification/demo/with-btn-onclose.md index 781ad54894..3b4bb237e2 100644 --- a/components/notification/demo/with-btn-onclose.md +++ b/components/notification/demo/with-btn-onclose.md @@ -9,7 +9,7 @@ ````jsx var notification = require('antd/lib/notification'); -var close = function() { +var close = function(key) { // 自定义按钮关闭时的业务处理 console.log("我被自定义的关闭按钮关闭了!"); // 隐藏提醒框 @@ -27,7 +27,9 @@ var openNotification = function() { notification.open({ message: "这是标题", description: "这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案", - btn: btn + btn: btn, + btnClose: close, + onClose: onClose }); }; diff --git a/components/notification/demo/with-btn.md b/components/notification/demo/with-btn.md index a4e0758add..985e966db6 100644 --- a/components/notification/demo/with-btn.md +++ b/components/notification/demo/with-btn.md @@ -9,8 +9,9 @@ ````jsx var notification = require('antd/lib/notification'); -var btnClick = function() { - console.log('我被自定义的按钮点击了!'); +var btnClick = function(key) { + // 隐藏提醒框 + notification.close(key); }; var close = function(){ @@ -24,7 +25,7 @@ var openNotification = function() { message: "这是标题", description: "这是提示框的文案这是提示框示框的文案这是提示是提示框的文案这是提示框的文案", btn: btn, - btnClose: true, + btnClose: btnClick, onClose: close }); }; diff --git a/components/notification/index.jsx b/components/notification/index.jsx index 6a87226723..55d093e825 100644 --- a/components/notification/index.jsx +++ b/components/notification/index.jsx @@ -7,7 +7,7 @@ let notificationInstance; function callback(key, btnCose) { if (btnCose) { - api.close(key); + btnCose(key); } } diff --git a/components/popconfirm/demo/placement.md b/components/popconfirm/demo/placement.md index bbdcd1a12c..2f77a61ddc 100644 --- a/components/popconfirm/demo/placement.md +++ b/components/popconfirm/demo/placement.md @@ -19,15 +19,15 @@ React.render(
, document.getElementById('components-popconfirm-demo-placement')); ```` diff --git a/components/popover/demo/placement.md b/components/popover/demo/placement.md index 09b3e643be..dd02dfcdef 100644 --- a/components/popover/demo/placement.md +++ b/components/popover/demo/placement.md @@ -18,15 +18,15 @@ React.render(