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,
...options,
setup (props, ctx) {
const nuxtApp = useNuxtApp()
const res = setup ? Promise.resolve(nuxtApp.runWithContext(() => setup(props, ctx))).then(r => r || {}) : {}
const res = setup ? setup(props, ctx) : {}
const promises: Promise<any>[] = []
if (options.asyncData) {