From 825b0bf2e38cea121c9635321772c4c0404e029d Mon Sep 17 00:00:00 2001 From: Yasser Lahbibi Date: Sun, 20 Oct 2024 13:26:17 +0200 Subject: [PATCH] fix: rename key to cmpKey --- packages/nuxt/src/app/components/nuxt-island.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nuxt/src/app/components/nuxt-island.ts b/packages/nuxt/src/app/components/nuxt-island.ts index e17304c3e0..287f5768da 100644 --- a/packages/nuxt/src/app/components/nuxt-island.ts +++ b/packages/nuxt/src/app/components/nuxt-island.ts @@ -126,13 +126,13 @@ export default defineComponent({ } } - const key = `${props.name}_${hashId.value}` - const ssrHTML = ref(nuxtApp.payload.data[key]?.html || '') + const cmpKey = `${props.name}_${hashId.value}` + const ssrHTML = ref(nuxtApp.payload.data[cmpKey]?.html || '') if (import.meta.client && instance.vnode?.el && !ssrHTML.value) { ssrHTML.value = getFragmentHTML(instance.vnode.el, true)?.join('') || '' - nuxtApp.payload.data[key] ||= {} - nuxtApp.payload.data[key].html = ssrHTML.value + nuxtApp.payload.data[cmpKey] ||= {} + nuxtApp.payload.data[cmpKey].html = ssrHTML.value } const uid = ref(ssrHTML.value.match(SSR_UID_RE)?.[1] ?? getId())