mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 00:52:01 +00:00
fix: use component html string inside payload
This commit is contained in:
parent
49242b2500
commit
200bf3589a
@ -126,11 +126,11 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const ssrHTML = ref<string>('')
|
const key = `${props.name}_${hashId.value}`
|
||||||
|
const ssrHTML = ref<string>(nuxtApp.payload.data[key]?.html || '')
|
||||||
|
|
||||||
if (import.meta.client && instance.vnode?.el) {
|
if (import.meta.client && instance.vnode?.el && !ssrHTML.value) {
|
||||||
ssrHTML.value = getFragmentHTML(instance.vnode.el, true)?.join('') || ''
|
ssrHTML.value = getFragmentHTML(instance.vnode.el, true)?.join('') || ''
|
||||||
const key = `${props.name}_${hashId.value}`
|
|
||||||
nuxtApp.payload.data[key] ||= {}
|
nuxtApp.payload.data[key] ||= {}
|
||||||
nuxtApp.payload.data[key].html = ssrHTML.value
|
nuxtApp.payload.data[key].html = ssrHTML.value
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user