-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathapp.vue
82 lines (78 loc) · 1.97 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<script setup lang="ts">
import { appKeywords, appName } from "@/constants/index";
import { useDefaultInit, useInit, useUmounted } from "@/init/index";
// https://nuxt.com.cn/docs/guide/directory-structure/app
useHead({
title: `${appName}✨`,
meta: [
{
name: "description",
content: "极物聊天 - 开启你的畅聊之旅!",
},
],
htmlAttrs: {
lang: "zh",
},
});
useSeoMeta({
title: `${appName}✨`,
description: "极物聊天 - 开启你的畅聊之旅!",
keywords: appKeywords,
});
// 初始化
const route = useRoute();
const setting = useSettingStore();
const isIframe = ref(false);
onMounted(() => {
if (window) // 判断是否在iframe中
isIframe.value = window?.self !== undefined && window?.self !== window?.top;
if (route.path === "/msg" || route.path.startsWith("/extend") || (setting.isDesktop && route.path === "/login")) // 进入消息页面
useDefaultInit();
else
useInit();
});
onUnmounted(useUmounted);
</script>
<template>
<main
class="h-100dvh flex-row-c-c"
>
<div
class="h-full w-full overflow-hidden bg-color"
:class="{
'sm:(w-1150px mx-a h-860px) md:(w-1360px mx-a h-860px) shadow-lg shadow-[#00000010]': !isIframe && setting.isWeb,
'rounded-1.5 border-default': setting.isDesktop || !setting.isMobileSize,
}"
>
<NuxtLayout>
<NuxtPage
class="h-full w-full"
/>
</NuxtLayout>
</div>
</main>
</template>
<style lang="scss">
// .layout-enter-active,
// .layout-leave-active,
// .page-enter-active,
// .page-leave-active {
// transition-duration: 0.2s;
// will-change: opacity transform;
// transform: none;
// }
// .layout-enter-from,
// .layout-leave-to,
// .page-enter-from,
// .page-leave-to {
// opacity: 0;
// transform: scale(0.9);
// }
// .dark .layout-enter-from,
// .dark .layout-leave-to,
// .dark .page-enter-from,
// .dark .page-leave-to {
// opacity: 0;
// transform: scale(0.9) translateY(10px);
// }
</style>