[improvement] Notify: improve event binding (#3640)

This commit is contained in:
neverland
2019-06-26 14:26:03 +08:00
committed by GitHub
parent c6f8fca41f
commit 344b105e0e
2 changed files with 7 additions and 15 deletions
+5 -4
View File
@@ -26,6 +26,11 @@ function Notify(options: NotifyOptions) {
instance.onClick(event);
}
},
close() {
if (instance.onClose) {
instance.onClose();
}
},
opened() {
if (instance.onOpened) {
instance.onOpened();
@@ -67,10 +72,6 @@ function defaultOptions(): NotifyOptions {
Notify.clear = () => {
if (instance) {
instance.value = false;
if (instance.onClose) {
instance.onClose();
}
}
};