1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
import Vue from 'vue';
import VueRouter from 'vue-router';
import Buefy from 'buefy'
import 'buefy/lib/buefy.css'
import Ads from 'vue-google-adsense';
import VueAnalytics from 'vue-analytics'
import App from './App.vue';
import ModeTab from './ModeTab.vue';
// Buefy's Bulma components CSS will be purged in production!
// Add exceptions to webpack.config.js PurgecssPlugin
Vue.use(VueRouter);
Vue.use(Buefy);
Vue.use(require('vue-script2'));
Vue.use(Ads.Adsense);
const router = new VueRouter({
routes: [ {
path: '/',
name: 'home',
component: ModeTab,
} ]
});
Vue.use(VueAnalytics, {
id: 'UA-118868480-1',
router,
debug: {
sendHitTask: process.env.NODE_ENV === 'production',
enabled: process.env.NODE_ENV !== 'production',
}
});
new Vue({
router,
el: '#app',
render: h => h(App),
mounted: function() {
if (window.matchMedia('(display-mode: standalone)').matches || window.navigator.standalone === true) {
this.$ga.event('PWA', 'started');
}
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('/service-worker.js').then((registration) => {
if (typeof registration.update == 'function') {
this.$ga.event('PWA', 'update');
registration.update();
}
});
}
},
});
|