app.vue
1.2 KB
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
<template>
<NuxtLayout>
<NuxtPage></NuxtPage>
</NuxtLayout>
</template>
<script lang="ts" setup>
import { getWebSite } from "~/api/webSite";
import { getClassifyList } from "~/api/classify";
import type { webSiteType } from "~/api/types/webSite";
import type { classifyType } from "~/api/types/classify";
const webSite = useState<webSiteType>("webSite");
const sortList = useState<classifyType[]>("sortTree");
const { data: webSiteData } = await useAsyncData(
"webSite",
async () => {
const res = await getWebSite();
return res;
},
{
server: true,
lazy: false,
getCachedData: () => null,
}
);
const { data: sortListData } = await useAsyncData(
"sortList",
async () => {
const res = await getClassifyList();
return res;
},
{
server: true,
lazy: false,
getCachedData: () => null,
}
);
if (webSiteData.value) {
webSite.value = webSiteData.value;
}
if (sortListData.value) {
sortList.value = sortListData.value;
}
</script>
<style>
.scroll-container {
/* 隐藏滚动条 */
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE/Edge */
}
.scroll-container::-webkit-scrollbar {
display: none; /* Chrome/Safari/Opera */
}
#translate {
display: none;
}
</style>