Skip to content

Commit

Permalink
Remove the listener beforedestroy
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Ambrosini <[email protected]>
  • Loading branch information
marcoambrosini committed Apr 8, 2020
1 parent 3b944b9 commit 082e251
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/AppContent/AppContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ export default {
mounted() {
if (this.allowSwipeNavigation) {
this.mc = new Hammer(this.$el, { cssProps: { userSelect: 'text' } })
this.mc.on('swipeleft swiperight', e => {
this.handleSwipe(e)
})
this.mc.on('swipeleft swiperight', this.handleSwipe)
}
},
beforeDestroy() {
this.mc.off('swipeleft swiperight', this.handleSwipe)
},
methods: {
// handle the swipe event
handleSwipe(e) {
Expand Down

0 comments on commit 082e251

Please sign in to comment.