fix(nuxt): init payload when using islands with ssr: false

This commit is contained in:
Daniel Roe 2024-03-12 17:06:46 -07:00
parent 8010b04f69
commit f080c426a2
No known key found for this signature in database
GPG Key ID: CBC814C393D93268

View File

@ -119,6 +119,7 @@ export default defineComponent({
if (import.meta.client && nuxtApp.isHydrating) { if (import.meta.client && nuxtApp.isHydrating) {
ssrHTML.value = getFragmentHTML(instance.vnode?.el ?? null, true)?.join('') || '' ssrHTML.value = getFragmentHTML(instance.vnode?.el ?? null, true)?.join('') || ''
const key = `${props.name}_${hashId.value}` const key = `${props.name}_${hashId.value}`
nuxtApp.payload.data[key] ||= {}
nuxtApp.payload.data[key].html = ssrHTML.value nuxtApp.payload.data[key].html = ssrHTML.value
} }