[new feauture] Notify: add onClose option

This commit is contained in:
陈嘉涵
2019-05-30 12:00:47 +08:00
parent 82134fe402
commit 333666f506
6 changed files with 18 additions and 3 deletions

View File

@@ -53,6 +53,7 @@ function defaultOptions(): NotifyOptions {
background: RED,
duration: 3000,
className: '',
onClose: null,
onClick: null
};
}
@@ -60,6 +61,10 @@ function defaultOptions(): NotifyOptions {
Notify.clear = () => {
if (instance) {
instance.value = false;
if (instance.onClose) {
instance.onClose();
}
}
};