From e1800858007c016e8e0ec9f793ed88431585fe41 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 2081b96307..29193a0616 100644 --- a/packages/nuxt/src/app/composables/asyncData.ts +++ b/packages/nuxt/src/app/composables/asyncData.ts @@ -525,7 +525,7 @@ function clearNuxtDataByKey (nuxtApp: NuxtApp, key: string): void { } if (nuxtApp._asyncData[key]) { - nuxtApp._asyncData[key]!.data.value = nuxtApp._asyncData[key]!._default() + nuxtApp._asyncData[key]!.data.value = unref(nuxtApp._asyncData[key]!._default()) nuxtApp._asyncData[key]!.error.value = undefined nuxtApp._asyncData[key]!.pending.value = false nuxtApp._asyncData[key]!.status.value = 'idle'