-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.vue
40 lines (36 loc) · 927 Bytes
/
app.vue
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
<script setup>
import { useGlobalVariablesStore } from './store/globalVariables';
import { useWindowScroll } from '@vueuse/core';
const { x, y } = useWindowScroll();
const globalVariables = useGlobalVariablesStore();
let pageTitle = ref('');
watch(x, () => {
globalVariables.$patch({
ScrollValueX: x.value,
});
});
watch(y, () => {
globalVariables.$patch({
ScrollValueY: y.value,
});
});
onMounted(() => {
globalVariables.$patch({
ScrollValueX: x.value,
ScrollValueY: y.value,
});
});
globalVariables.$subscribe((mutation, state) => {
if (state.currentlyPlayingSong.hasOwnProperty('title')) {
pageTitle.value = state.currentlyPlayingSong.title;
}
});
</script>
<template>
<NuxtLayout>
<Title>{{
pageTitle === '' ? 'YouTube Music' : pageTitle + ' - YouTube Music'
}}</Title>
<NuxtPage />
</NuxtLayout>
</template>