From af82fae411e38dfea11cc7758a87d18e702fe258 Mon Sep 17 00:00:00 2001 From: ShanaMaid Date: Mon, 2 Jul 2018 15:03:20 +0800 Subject: [PATCH] =?UTF-8?q?feat(notification):=20notification=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=BF=94=E5=9B=9Ekey=E7=94=A8=E4=BA=8Eclose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Notification/Notification.tsx | 1 + docs/pages/Notification/config.md | 3 +++ 2 files changed, 4 insertions(+) diff --git a/components/Notification/Notification.tsx b/components/Notification/Notification.tsx index 7d7428c..8b0523f 100644 --- a/components/Notification/Notification.tsx +++ b/components/Notification/Notification.tsx @@ -122,6 +122,7 @@ const renderNotifications = ( }); insertContainer(); + return alertKey; }; const closeNotification = (key: string | number) => { diff --git a/docs/pages/Notification/config.md b/docs/pages/Notification/config.md index 4d3cdd4..a795c0a 100644 --- a/docs/pages/Notification/config.md +++ b/docs/pages/Notification/config.md @@ -1,3 +1,4 @@ +- notification.open(config) - notification.success(config) - notification.error(config) - notification.info(config) @@ -5,4 +6,6 @@ - notification.close(key: String) - notification.destroy() +`open`、`success`、`error`、`info`、`warn`都会返回一个`key`,用于`close`方法来关闭制定窗口。 + config 参数如下: \ No newline at end of file