Skip to content

Commit

Permalink
feat(notification): notification添加返回key用于close
Browse files Browse the repository at this point in the history
  • Loading branch information
ShanaMaid committed Jul 2, 2018
1 parent a62e52e commit af82fae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/Notification/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ const renderNotifications = (
});

insertContainer();
return alertKey;
};

const closeNotification = (key: string | number) => {
Expand Down
3 changes: 3 additions & 0 deletions docs/pages/Notification/config.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
- notification.open(config)
- notification.success(config)
- notification.error(config)
- notification.info(config)
- notification.warn(config)
- notification.close(key: String)
- notification.destroy()

`open``success``error``info``warn`都会返回一个`key`,用于`close`方法来关闭制定窗口。

config 参数如下:

0 comments on commit af82fae

Please sign in to comment.