Skip to content

Commit

Permalink
feat(snackbar): add show and hide event as per mdc 0.28.0
Browse files Browse the repository at this point in the history
  • Loading branch information
stasson committed Jan 13, 2018
1 parent 69c983a commit eb372d2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion components/snackbar/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@ properties and their usage.
| `dismisses-on-action` |Boolean| true| Whether the snackbar will be dimissed when the user presses the action button. |
| `align-start` |Boolean| false| Whether the snackbar is start aligned. |


### methods

| method | Description |
|--------|-------------|
| `show(data)` | trigger the display of a message with optional action.|

# events
| `@show` | notify listeners that the snackbar has been shown. |
| `@hide` | notify listeners that the snackbar has been hidden. |

### Reference
- <https://material.io/components/web/catalog/snackbars>

Expand Down
4 changes: 3 additions & 1 deletion components/snackbar/mdc-snackbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ export default {
},
deregisterTransitionEndHandler: (handler) => {
this.$refs.root.removeEventListener(getCorrectEventName(window, 'transitionend'), handler)
}
},
notifyShow: () => this.$emit('show'),
notifyHide: () => this.$emit('hide'),
})
this.foundation.init()
if (this.event) {
Expand Down

0 comments on commit eb372d2

Please sign in to comment.