修改页面布局大修改
This commit is contained in:
@@ -2,9 +2,6 @@
|
||||
import type { ContentNavigationItem } from '@nuxt/content'
|
||||
import { findPageHeadline } from '#ui-pro/utils/content'
|
||||
|
||||
// definePageMeta({
|
||||
// layout: 'docs'
|
||||
// })
|
||||
|
||||
const route = useRoute()
|
||||
const appConfig = useAppConfig()
|
||||
@@ -47,9 +44,15 @@ const queryPath = computed(() => {
|
||||
}
|
||||
})
|
||||
|
||||
// 根据路径判断查询的集合
|
||||
const collection = computed(() => {
|
||||
return queryPath.value.startsWith('/blog') ? 'blog' : 'docs'
|
||||
})
|
||||
|
||||
|
||||
const { data: page } = await useAsyncData(
|
||||
`page-${route.path}`, // 使用更具体的 key
|
||||
() => queryCollection('docs').path(queryPath.value).first(),
|
||||
() => queryCollection(collection.value).path(queryPath.value).first(),
|
||||
{
|
||||
default: () => null // 提供默认值
|
||||
}
|
||||
|
Reference in New Issue
Block a user