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