From c7d12a8aaaad45b6d131fedd8a2169348c0ef3f5 Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 25 Mar 2019 19:12:32 +0100 Subject: Use es6 method syntax --- src/InstallNotification.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/InstallNotification.vue') diff --git a/src/InstallNotification.vue b/src/InstallNotification.vue index a60ec9c..f870ee5 100644 --- a/src/InstallNotification.vue +++ b/src/InstallNotification.vue @@ -22,13 +22,13 @@ import Vue from 'vue'; export default Vue.component('install-notification', { - data: function() { + data() { return { deferredPrompt: undefined, }; }, methods: { - promptInstall: function(p) { + promptInstall(p) { this.$ga.event('PWA', 'available'); p.preventDefault(); this.deferredPrompt = p; @@ -37,15 +37,15 @@ export default Vue.component('install-notification', { this.deferredPrompt = null; }); }, - installed: function(e) { + installed(e) { this.$ga.event('PWA', 'installed'); }, }, - created: function() { + created() { window.addEventListener('beforeinstallprompt', this.promptInstall); window.addEventListener('appinstalled', this.installed); }, - destroyed: function() { + destroyed() { window.removeEventListener('beforeinstallprompt', this.promptInstall); window.removeEventListener('appinstalled', this.installed); }, -- cgit v1.3.1