mirror of
https://github.com/eugene-serb/wavelovers.git
synced 2023-09-09 23:41:16 +03:00
5b70538117
- added condition for link tags. - improve stability. - linted code. - up version. - build.
47 lines
1.3 KiB
Vue
47 lines
1.3 KiB
Vue
<template>
|
|
<HeaderItem />
|
|
<main class="page container">
|
|
<div class="wavelovers">
|
|
<router-view />
|
|
</div>
|
|
</main>
|
|
<FooterItem />
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent } from 'vue';
|
|
import store from '@/store/index';
|
|
import HeaderItem from '@/components/HeaderItem.vue';
|
|
import FooterItem from '@/components/FooterItem.vue';
|
|
|
|
export default defineComponent({
|
|
name: 'App',
|
|
components: {
|
|
HeaderItem: HeaderItem,
|
|
FooterItem: FooterItem,
|
|
},
|
|
methods: {
|
|
addGamepad: function (event: GamepadEvent): void {
|
|
store.dispatch('addGamepad', event);
|
|
},
|
|
deleteGamepad: function (event: GamepadEvent): void {
|
|
store.dispatch('deleteGamepad', event);
|
|
},
|
|
addEventListeners: function (): void {
|
|
window.addEventListener('gamepadconnected', this.addGamepad);
|
|
window.addEventListener('gamepaddisconnected', this.deleteGamepad);
|
|
},
|
|
removeEventListeners: function (): void {
|
|
window.removeEventListener('gamepadconnected', this.addGamepad);
|
|
window.removeEventListener('gamepaddisconnected', this.deleteGamepad);
|
|
},
|
|
},
|
|
mounted() {
|
|
this.addEventListeners();
|
|
},
|
|
unmounted() {
|
|
this.removeEventListeners();
|
|
},
|
|
});
|
|
</script>
|