diff --git a/docs/app/components/PostPage.vue b/docs/app/components/PostPage.vue index 9f70709c6..5c6aea072 100644 --- a/docs/app/components/PostPage.vue +++ b/docs/app/components/PostPage.vue @@ -11,9 +11,9 @@ const { type } = defineProps({ const route = useRoute() const siteConfig = useSiteConfig() -const { data } = await useAsyncData(route.path, () => Promise.all([ - queryCollection('posts').path(route.path).first(), - queryCollectionItemSurroundings('posts', route.path, { fields: ['title', 'description'] }) +const { data } = await useAsyncData(route.path, (_nuxtApp, { signal }) => Promise.all([ + queryCollection('posts').path(route.path).first({ signal }), + queryCollectionItemSurroundings('posts', route.path, { fields: ['title', 'description'] }, { signal }) .where('path', 'LIKE', `/${type}%`) .where('draft', '=', 0) .order('date', 'DESC'), diff --git a/docs/app/components/example/ExampleFulltextFusejs.vue b/docs/app/components/example/ExampleFulltextFusejs.vue index ff69047ba..26cc4f6a3 100644 --- a/docs/app/components/example/ExampleFulltextFusejs.vue +++ b/docs/app/components/example/ExampleFulltextFusejs.vue @@ -2,7 +2,7 @@ import Fuse from 'fuse.js' const query = ref('') -const { data } = await useAsyncData('search-data', () => queryCollectionSearchSections('docs')) +const { data } = await useAsyncData('search-data', (_nuxtApp, { signal }) => queryCollectionSearchSections('docs', { signal })) const fuse = new Fuse(data.value || [], { keys: [ diff --git a/docs/app/components/example/ExampleFulltextMiniSearch.vue b/docs/app/components/example/ExampleFulltextMiniSearch.vue index 0ef4dceb9..8ef09f99e 100644 --- a/docs/app/components/example/ExampleFulltextMiniSearch.vue +++ b/docs/app/components/example/ExampleFulltextMiniSearch.vue @@ -2,7 +2,7 @@ import MiniSearch from 'minisearch' const query = ref('') -const { data } = await useAsyncData('search-data', () => queryCollectionSearchSections('docs')) +const { data } = await useAsyncData('search-data', (_nuxtApp, { signal }) => queryCollectionSearchSections('docs', { signal })) const miniSearch = new MiniSearch({ fields: ['title', 'content'], diff --git a/docs/app/pages/blog/index.vue b/docs/app/pages/blog/index.vue index 3c3fe15a5..134121e0f 100644 --- a/docs/app/pages/blog/index.vue +++ b/docs/app/pages/blog/index.vue @@ -3,16 +3,16 @@ import { titleCase } from 'scule' const siteConfig = useSiteConfig() -const { data: page } = await useAsyncData('blog-landing', () => queryCollection('landing').path('/blog').first()) +const { data: page } = await useAsyncData('blog-landing', (_nuxtApp, { signal }) => queryCollection('landing').path('/blog').first({ signal })) if (!page.value) { throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true }) } -const { data: posts } = await useAsyncData('blog-posts', () => queryCollection('posts') +const { data: posts } = await useAsyncData('blog-posts', (_nuxtApp, { signal }) => queryCollection('posts') .where('path', 'LIKE', '/blog%') .where('draft', '=', 0) .order('date', 'DESC') - .all(), + .all({ signal }), ) useSeoMeta({ diff --git a/docs/app/pages/changelog/index.vue b/docs/app/pages/changelog/index.vue index 97a52d561..20ce8f786 100644 --- a/docs/app/pages/changelog/index.vue +++ b/docs/app/pages/changelog/index.vue @@ -11,16 +11,16 @@ const { isScrolling, arrivedState } = useScroll(document) const siteConfig = useSiteConfig() -const { data: page } = await useAsyncData('changelog-landing', () => queryCollection('landing').path('/changelog').first()) +const { data: page } = await useAsyncData('changelog-landing', (_nuxtApp, { signal }) => queryCollection('landing').path('/changelog').first({ signal })) if (!page.value) { throw createError({ statusCode: 404, statusMessage: 'Page not found', fatal: true }) } -const { data: posts } = await useAsyncData('changelog-posts', () => queryCollection('posts') +const { data: posts } = await useAsyncData('changelog-posts', (_nuxtApp, { signal }) => queryCollection('posts') .where('path', 'LIKE', '/changelog%') .where('draft', '=', 0) .order('date', 'DESC') - .all(), + .all({ signal }), ) useSeoMeta({ diff --git a/docs/app/pages/studio/index.vue b/docs/app/pages/studio/index.vue index dd5ec2fd2..94a72b2e8 100644 --- a/docs/app/pages/studio/index.vue +++ b/docs/app/pages/studio/index.vue @@ -1,7 +1,7 @@ diff --git a/examples/i18n/app/pages/[...slug].vue b/examples/i18n/app/pages/[...slug].vue index b20922e42..6dd5b4c93 100644 --- a/examples/i18n/app/pages/[...slug].vue +++ b/examples/i18n/app/pages/[...slug].vue @@ -6,9 +6,9 @@ const route = useRoute() const { locale, localeProperties } = useI18n() const slug = computed(() => withLeadingSlash(String(route.params.slug))) -const { data: page } = await useAsyncData('page-' + slug.value, async () => { +const { data: page } = await useAsyncData('page-' + slug.value, async (_nuxtApp, { signal }) => { const collection = ('content_' + locale.value) as keyof Collections - const content = await queryCollection(collection).path(slug.value).first() + const content = await queryCollection(collection).path(slug.value).first({ signal }) // Possibly fallback to default locale if content is missing in non-default locale diff --git a/examples/ui/app/pages/[...slug].vue b/examples/ui/app/pages/[...slug].vue index b9e3943f3..6503256af 100644 --- a/examples/ui/app/pages/[...slug].vue +++ b/examples/ui/app/pages/[...slug].vue @@ -1,8 +1,8 @@ diff --git a/playground/pages/content-v2/[...slug].vue b/playground/pages/content-v2/[...slug].vue index a2292ee1c..261b39c2c 100644 --- a/playground/pages/content-v2/[...slug].vue +++ b/playground/pages/content-v2/[...slug].vue @@ -1,16 +1,17 @@