Skip to content

Commit

Permalink
onClose callback function
Browse files Browse the repository at this point in the history
  • Loading branch information
adecrown committed Mar 19, 2020
1 parent a8ce098 commit 259bc0c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ this.$whoosh({
width: 400,
height: 250
}

// (optional) Provide a callback function that gets called when the notification closes
onClose: () =>{}

});
```

Expand Down
1 change: 1 addition & 0 deletions src/components/Whoosh/Whoosh.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default class Whoosh extends Vue {
}
removeCard(event: CardContent) {
this.whooshList = this.whooshList.filter(x => x.id !== event.id);
event.onClose ? event.onClose() : null;
}
actionOnClick(data: CardContent) {
if (this.closeOnClick) {
Expand Down
1 change: 1 addition & 0 deletions src/components/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ export type CardContent = {
width: number;
height: number;
};
onClose?: Function;
};

0 comments on commit 259bc0c

Please sign in to comment.