fix(nuxt): don't wrap setup with runWithContext

This commit is contained in:
Julien Huang 2024-08-23 00:08:19 +02:00
parent 1cce11f6a4
commit 47ac6bb843

View File

@ -47,8 +47,7 @@ export const defineNuxtComponent: typeof defineComponent =
_fetchKeyBase: key, _fetchKeyBase: key,
...options, ...options,
setup (props, ctx) { setup (props, ctx) {
const nuxtApp = useNuxtApp() const res = setup ? setup(props, ctx) : {}
const res = setup ? Promise.resolve(nuxtApp.runWithContext(() => setup(props, ctx))).then(r => r || {}) : {}
const promises: Promise<any>[] = [] const promises: Promise<any>[] = []
if (options.asyncData) { if (options.asyncData) {