-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.vue
49 lines (43 loc) · 916 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
41
42
43
44
45
46
47
48
49
<script setup lang="ts">
import topBar from '~/components/topBar.vue';
import loading from "~/components/loading.vue";
import { useHead, onBeforeRouteUpdate, onBeforeRouteLeave } from "#app";
import {onMounted} from "vue";
const isLoading = ref<boolean>(true);
const waitLoading = () => {
window.addEventListener('load', ()=>{
isLoading.value = false;
})
}
useHead({
bodyAttrs: {
class: 'scroll-smooth'
}
})
onMounted(()=>{
waitLoading()
})
</script>
<template>
<div class="bg-base">
<nuxt-page />
<top-bar />
<!--
<transition name="slide">
<div v-if="isLoading" class="fixed inset-0 bg-black z-50 flex justify-center">
<loading />
</div>
</transition>
-->
</div>
</template>
<style>
.slide-enter-active,
.slide-leave-active {
transition: transform 0.5s ease;
}
.slide-enter-from,
.slide-leave-to {
transform: translateY(-100%);
}
</style>