From d6c3c2439a4c1e233e0f81e07d1b592c7e0520a6 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 10 Apr 2023 22:57:13 +0100 Subject: [PATCH] feat(nuxt): support async transform of object properties (#20182) --- docs/1.getting-started/6.data-fetching.md | 2 +- docs/2.guide/1.concepts/1.auto-imports.md | 2 +- .../nuxt/src/app/composables/component.ts | 7 +-- packages/nuxt/src/core/nuxt.ts | 8 +++- packages/nuxt/src/core/plugins/unctx.ts | 44 ++++++++++++------- packages/nuxt/src/pages/module.ts | 6 ++- packages/schema/build.config.ts | 1 + packages/schema/package.json | 1 + packages/schema/src/config/build.ts | 14 ++++++ pnpm-lock.yaml | 5 ++- test/fixtures/basic/pages/chunk-error.vue | 5 ++- .../basic/pages/legacy/async-data.vue | 5 +++ .../basic/pages/navigate-to-redirect.vue | 4 +- 13 files changed, 73 insertions(+), 31 deletions(-) diff --git a/docs/1.getting-started/6.data-fetching.md b/docs/1.getting-started/6.data-fetching.md index 7b091c6679..089f61b40a 100644 --- a/docs/1.getting-started/6.data-fetching.md +++ b/docs/1.getting-started/6.data-fetching.md @@ -356,7 +356,7 @@ const { data } = await useFetch('/api/price') ## Using Async Setup -If you are using `async setup()`, the current component instance will be lost after the first `await`. (This is a Vue 3 limitation.) If you want to use multiple async operations, such as multiple calls to `useFetch`, you will need to use ` diff --git a/test/fixtures/basic/pages/legacy/async-data.vue b/test/fixtures/basic/pages/legacy/async-data.vue index 3ca56e0798..8b36739185 100644 --- a/test/fixtures/basic/pages/legacy/async-data.vue +++ b/test/fixtures/basic/pages/legacy/async-data.vue @@ -6,7 +6,12 @@