lint:fix all
This commit is contained in:
@@ -24,7 +24,7 @@ const { data: page } = await useAsyncData(
|
||||
{
|
||||
default: () => null // 提供默认值
|
||||
}
|
||||
);
|
||||
)
|
||||
|
||||
if (!page.value) {
|
||||
throw createError({
|
||||
@@ -32,10 +32,9 @@ if (!page.value) {
|
||||
statusMessage: '文档不存在',
|
||||
message: '当前页面不存在,请您检查路径是否正确',
|
||||
fatal: true
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const { data: surround } = await useAsyncData(`${route.path}-surround`, () => {
|
||||
return queryCollectionItemSurroundings('docs', route.path, {
|
||||
fields: ['description']
|
||||
@@ -69,7 +68,7 @@ const editLink = computed(() => {
|
||||
appConfig.github.branch,
|
||||
appConfig.github.rootDir,
|
||||
'content',
|
||||
`${page.value?.stem}.${page.value?.extension}`,
|
||||
`${page.value?.stem}.${page.value?.extension}`
|
||||
].filter(Boolean).join('/')
|
||||
})
|
||||
|
||||
@@ -89,29 +88,60 @@ const links = computed(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UPage v-if="page" :class="pageFontSizeClass">
|
||||
<UPageHeader :title="page.title" :description="page.description" :headline="headline" :ui="{
|
||||
wrapper: 'flex-row items-center flex-wrap justify-between ',
|
||||
}">
|
||||
<UPage
|
||||
v-if="page"
|
||||
:class="pageFontSizeClass"
|
||||
>
|
||||
<UPageHeader
|
||||
:title="page.title"
|
||||
:description="page.description"
|
||||
:headline="headline"
|
||||
:ui="{
|
||||
wrapper: 'flex-row items-center flex-wrap justify-between '
|
||||
}"
|
||||
>
|
||||
<template #links>
|
||||
<UButton v-for="(link, index) in page.links" :key="index" size="sm" v-bind="link" />
|
||||
<UButton
|
||||
v-for="(link, index) in page.links"
|
||||
:key="index"
|
||||
size="sm"
|
||||
v-bind="link"
|
||||
/>
|
||||
|
||||
<DocsPageHeaderLinks />
|
||||
</template>
|
||||
</UPageHeader>
|
||||
|
||||
<UPageBody>
|
||||
<ContentRenderer v-if="page" :value="page" />
|
||||
<ContentRenderer
|
||||
v-if="page"
|
||||
:value="page"
|
||||
/>
|
||||
|
||||
<USeparator>
|
||||
<div v-if="editLink" class="flex items-center gap-2 text-sm text-muted">
|
||||
<UButton variant="link" color="neutral" :to="editLink" target="_blank" icon="lucide-pen"
|
||||
:ui="{ leadingIcon: 'size-4' }">
|
||||
<div
|
||||
v-if="editLink"
|
||||
class="flex items-center gap-2 text-sm text-muted"
|
||||
>
|
||||
<UButton
|
||||
variant="link"
|
||||
color="neutral"
|
||||
:to="editLink"
|
||||
target="_blank"
|
||||
icon="lucide-pen"
|
||||
:ui="{ leadingIcon: 'size-4' }"
|
||||
>
|
||||
编辑页面
|
||||
</UButton>
|
||||
or
|
||||
<UButton variant="link" color="neutral" :to="`${appConfig.github.url}/issues/new/choose`" target="_blank"
|
||||
icon="lucide-alert-circle" :ui="{ leadingIcon: 'size-4' }">
|
||||
<UButton
|
||||
variant="link"
|
||||
color="neutral"
|
||||
:to="`${appConfig.github.url}/issues/new/choose`"
|
||||
target="_blank"
|
||||
icon="lucide-alert-circle"
|
||||
:ui="{ leadingIcon: 'size-4' }"
|
||||
>
|
||||
提交问题
|
||||
</UButton>
|
||||
</div>
|
||||
@@ -119,15 +149,32 @@ const links = computed(() => {
|
||||
<UContentSurround :surround="surround" />
|
||||
</UPageBody>
|
||||
|
||||
<template v-if="page?.body?.toc?.links?.length" #right>
|
||||
<template
|
||||
v-if="page?.body?.toc?.links?.length"
|
||||
#right
|
||||
>
|
||||
<div class="fixed top-24 right-15 w-auto">
|
||||
<UContentToc
|
||||
:title="appConfig.toc?.title"
|
||||
:links="page.body?.toc?.links"
|
||||
>
|
||||
<template
|
||||
v-if="appConfig.toc?.bottom"
|
||||
#bottom
|
||||
>
|
||||
<div
|
||||
class="hidden lg:block space-y-6 "
|
||||
:class="{ '!mt-5': page.body?.toc?.links?.length }"
|
||||
>
|
||||
<USeparator
|
||||
v-if="page.body?.toc?.links?.length"
|
||||
type="dashed"
|
||||
/>
|
||||
|
||||
<UContentToc :title="appConfig.toc?.title" :links="page.body?.toc?.links">
|
||||
<template v-if="appConfig.toc?.bottom" #bottom>
|
||||
<div class="hidden lg:block space-y-6 " :class="{ '!mt-5': page.body?.toc?.links?.length }">
|
||||
<USeparator v-if="page.body?.toc?.links?.length" type="dashed" />
|
||||
|
||||
<UPageLinks :title="appConfig.toc.bottom.title" :links="links" />
|
||||
<UPageLinks
|
||||
:title="appConfig.toc.bottom.title"
|
||||
:links="links"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</UContentToc>
|
||||
|
Reference in New Issue
Block a user