Browse Source

Merge pull request #140 from zhujun24/notification

optimize close function
pull/148/head
偏右 9 years ago
parent
commit
7af4457c94
  1. 6
      components/notification/demo/with-btn-onclose.md
  2. 7
      components/notification/demo/with-btn.md
  3. 2
      components/notification/index.jsx
  4. 6
      components/popconfirm/demo/placement.md
  5. 6
      components/popover/demo/placement.md
  6. 6
      components/tooltip/demo/placement.md

6
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
});
};

7
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
});
};

2
components/notification/index.jsx

@ -7,7 +7,7 @@ let notificationInstance;
function callback(key, btnCose) {
if (btnCose) {
api.close(key);
btnCose(key);
}
}

6
components/popconfirm/demo/placement.md

@ -19,15 +19,15 @@ React.render(<div>
<Popconfirm placement="left" title={text} onConfirm={confirm}>
<a href="javascript:;">左边</a>
</Popconfirm>
<Popconfirm placement="right" title={text} onConfirm={confirm}>
<a href="javascript:;">右边</a>
</Popconfirm>
<Popconfirm placement="top" title={text} onConfirm={confirm}>
<a href="javascript:;">上边</a>
</Popconfirm>
<Popconfirm placement="bottom" title={text} onConfirm={confirm}>
<a href="javascript:;">下边</a>
</Popconfirm>
<Popconfirm placement="right" title={text} onConfirm={confirm}>
<a href="javascript:;">右边</a>
</Popconfirm>
</div>, document.getElementById('components-popconfirm-demo-placement'));
````

6
components/popover/demo/placement.md

@ -18,15 +18,15 @@ React.render(<div>
<Popover placement="left" title={text} overlay={content}>
<button className="ant-btn"></button>
</Popover>
<Popover placement="right" title={text} overlay={content}>
<button className="ant-btn"></button>
</Popover>
<Popover placement="top" title={text} overlay={content}>
<button className="ant-btn"></button>
</Popover>
<Popover placement="bottom" title={text} overlay={content}>
<button className="ant-btn"></button>
</Popover>
<Popover placement="right" title={text} overlay={content}>
<button className="ant-btn"></button>
</Popover>
</div>, document.getElementById('components-popover-demo-placement'));
````

6
components/tooltip/demo/placement.md

@ -15,15 +15,15 @@ React.render(
<Tooltip placement="left" title={text}>
<a href="#">左边左边</a>
</Tooltip>
<Tooltip placement="right" title={text}>
<a href="#">右边右边</a>
</Tooltip>
<Tooltip placement="top" title={text}>
<a href="#">上边上边</a>
</Tooltip>
<Tooltip placement="bottom" title={text}>
<a href="#">下边下边</a>
</Tooltip>
<Tooltip placement="right" title={text}>
<a href="#">右边右边</a>
</Tooltip>
</div>
, document.getElementById('components-tooltip-demo-placement'));
````

Loading…
Cancel
Save