-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.vue
45 lines (42 loc) · 852 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
<script setup>
const nuxtApp = useNuxtApp();
nuxtApp.$router.options.scrollBehavior = (to) => {
if (to.hash === "") {
return { left: 0, top: 0 };
}
else {
return new Promise((resolve) => {
setTimeout(() => {
resolve({ el: to.hash, top: 48, left: 0, behavior: "smooth" });
}, 500);
});
}
};
</script>
<template>
<LoadingPage v-if="loading" />
<NuxtLayout>
<NuxtLoadingIndicator :throttle="0" />
<NuxtPage />
</NuxtLayout>
</template>
<script>
export default {
name: "App",
data () {
return {
loading: true
};
},
beforeMount () {
this.$nuxt.hook("page:finish", () => {
this.loading = false;
});
}
};
</script>
<style scoped>
.nuxt-loading-indicator {
background: repeating-linear-gradient(to right,#deff69 0%,#3e61c5 50%,#bfd0ff 100%)!important;
}
</style>