-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.vue
63 lines (57 loc) · 1.36 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<template>
<ClientOnly>
<NuxtLayout>
<UIXProgressLinear v-if="modalStore.isLoadingPage" class="z-10 absolute top-24 w-full" />
</NuxtLayout>
<AppModal v-if="$isActiveModal()" />
</ClientOnly>
</template>
<script setup lang="ts">
import { useModalStore } from '~~/store/modal';
const { $isActiveModal } = useNuxtApp();
const { locale, t } = useI18n();
const modalStore = useModalStore();
modalStore.$onAction(
({
// name, // name of the action
store, // store instance, same as `someStore`
// args, // array of parameters passed to the action
after, // hook after the action returns or resolves
// onError, // hook if the action throws or rejects
}) => {
after(() => {
if (store.activeModal) {
document.body.classList.add('overflow-hidden');
} else {
document.body.classList.remove('overflow-hidden');
}
});
},
);
const config = useRuntimeConfig();
useHead({
title: config.public.appName,
meta: [
{
name: 'description',
content: config.public.appDescription || t('TITLES.ATLAS_AI_POWERED_TOOLS'),
},
],
htmlAttrs: {
lang: locale.value,
},
});
onMounted(() => {
if (!config.public.cookiesPrivacyTerms) {
return;
}
useHead({
script: [
{
src: 'https://cdn.iubenda.com/iubenda.js',
defer: true,
},
],
});
});
</script>