-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.vue
43 lines (38 loc) · 914 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
<script setup lang="ts">
import type { Project, User } from '~/libs/types'
const config = useRuntimeConfig()
await callOnce(async () => {
try {
const user = await useFetchWithCache<User>('user', `${config.public.api}/users/me`, { credentials: 'include' })
useState<User>('user', () => user.value)
}
catch (err: any) {
console.error('Clearance Error :', err.message)
}
})
try {
const projects = await useFetchWithCache<Project[]>('projects', `${config.public.api}/projects`)
useState<Project[]>('projects', () => projects.value)
}
catch (err: any) {
ElMessage.error({
duration: 0,
message: err.message,
})
}
</script>
<template>
<nuxt-loading-indicator :height="5" />
<nuxt-layout>
<el-container direction="vertical">
<app-menu />
<nuxt-page />
<app-footer />
</el-container>
</nuxt-layout>
</template>
<style>
body {
margin: 0;
}
</style>