fix: rename key to cmpKey

This commit is contained in:
Yasser Lahbibi 2024-10-20 13:26:17 +02:00 committed by GitHub
parent 200bf3589a
commit 825b0bf2e3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -126,13 +126,13 @@ export default defineComponent({
}
}
const key = `${props.name}_${hashId.value}`
const ssrHTML = ref<string>(nuxtApp.payload.data[key]?.html || '')
const cmpKey = `${props.name}_${hashId.value}`
const ssrHTML = ref<string>(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<string>(ssrHTML.value.match(SSR_UID_RE)?.[1] ?? getId())