From 082e2512988ad9bb3322b345e2ca7f184c3c5647 Mon Sep 17 00:00:00 2001 From: Marco Ambrosini Date: Wed, 8 Apr 2020 13:15:28 +0200 Subject: [PATCH] Remove the listener beforedestroy Signed-off-by: Marco Ambrosini --- src/components/AppContent/AppContent.vue | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/AppContent/AppContent.vue b/src/components/AppContent/AppContent.vue index eb0a91d6e5..51f6dc9a12 100644 --- a/src/components/AppContent/AppContent.vue +++ b/src/components/AppContent/AppContent.vue @@ -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) {