[new feature] Notify: add onClick event

This commit is contained in:
陈嘉涵
2019-05-01 09:17:59 +08:00
parent 848786dd6e
commit 210122d518
8 changed files with 34 additions and 3 deletions
+11 -2
View File
@@ -19,7 +19,15 @@ function Notify(options: NotifyOptions) {
}
if (!instance) {
instance = mount(VanNotify);
instance = mount(VanNotify, {
on: {
click(event: Event) {
if (instance.onClick) {
instance.onClick(event);
}
}
}
});
}
options = {
@@ -44,7 +52,8 @@ function defaultOptions(): NotifyOptions {
color: WHITE,
background: RED,
duration: 3000,
className: ''
className: '',
onClick: null
};
}