2022-06-30 12:35:29 +03:00
|
|
|
<template>
|
2022-08-12 14:48:54 +03:00
|
|
|
<HeaderItem />
|
|
|
|
<main class="page container">
|
|
|
|
<div class="wavelovers">
|
|
|
|
<router-view />
|
|
|
|
</div>
|
|
|
|
</main>
|
|
|
|
<FooterItem />
|
2022-06-30 12:35:29 +03:00
|
|
|
</template>
|
|
|
|
|
2022-07-14 17:50:28 +03:00
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
2022-08-07 21:29:22 +03:00
|
|
|
import store from '@/store/index';
|
2022-08-12 14:48:54 +03:00
|
|
|
import HeaderItem from '@/components/HeaderItem.vue';
|
|
|
|
import FooterItem from '@/components/FooterItem.vue';
|
2022-06-30 12:35:29 +03:00
|
|
|
|
2022-07-14 17:50:28 +03:00
|
|
|
export default defineComponent({
|
2022-07-21 16:07:17 +03:00
|
|
|
name: 'App',
|
2022-08-07 21:29:22 +03:00
|
|
|
components: {
|
2022-08-12 14:48:54 +03:00
|
|
|
HeaderItem: HeaderItem,
|
|
|
|
FooterItem: FooterItem,
|
2022-08-07 21:29:22 +03:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
addEventListeners(): void {
|
|
|
|
window.addEventListener('gamepadconnected', (event: GamepadEvent) => store.dispatch('addGamepad', event));
|
|
|
|
window.addEventListener('gamepaddisconnected', (event: GamepadEvent) => store.dispatch('deleteGamepad', event));
|
|
|
|
},
|
|
|
|
removeEventListeners(): void {
|
|
|
|
window.removeEventListener('gamepadconnected', (event: GamepadEvent) => store.dispatch('addGamepad', event));
|
|
|
|
window.removeEventListener('gamepaddisconnected', (event: GamepadEvent) => store.dispatch('deleteGamepad', event));
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
this.addEventListeners();
|
|
|
|
},
|
|
|
|
unmounted() {
|
|
|
|
this.removeEventListeners();
|
|
|
|
},
|
2022-07-14 17:50:28 +03:00
|
|
|
});
|
2022-06-30 12:35:29 +03:00
|
|
|
</script>
|
|
|
|
|