From db889f07c9c279c049a6fa00fb0b1c6961f0a477 Mon Sep 17 00:00:00 2001 From: xjccc <546534045@qq.com> Date: Tue, 26 Nov 2024 16:45:59 +0800 Subject: [PATCH] fix(nuxt): unref the default value of asyncData when clearing (#30041) --- packages/nuxt/src/app/composables/asyncData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt/src/app/composables/asyncData.ts b/packages/nuxt/src/app/composables/asyncData.ts index 3a7ad32d72..9dc1144424 100644 --- a/packages/nuxt/src/app/composables/asyncData.ts +++ b/packages/nuxt/src/app/composables/asyncData.ts @@ -538,7 +538,7 @@ function clearNuxtDataByKey (nuxtApp: NuxtApp, key: string): void { } if (nuxtApp._asyncData[key]) { - nuxtApp._asyncData[key]!.data.value = resetAsyncDataToUndefined ? undefined : nuxtApp._asyncData[key]!._default() + nuxtApp._asyncData[key]!.data.value = resetAsyncDataToUndefined ? undefined : unref(nuxtApp._asyncData[key]!._default()) nuxtApp._asyncData[key]!.error.value = asyncDataDefaults.errorValue nuxtApp._asyncData[key]!.pending.value = false nuxtApp._asyncData[key]!.status.value = 'idle'