mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
Merge 825b0bf2e3
into edc299a043
This commit is contained in:
commit
24a0c4afe6
@ -127,13 +127,13 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
const ssrHTML = ref<string>('')
|
||||
const cmpKey = `${props.name}_${hashId.value}`
|
||||
const ssrHTML = ref<string>(nuxtApp.payload.data[cmpKey]?.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('') || ''
|
||||
const key = `${props.name}_${hashId.value}`
|
||||
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())
|
||||
|
Loading…
Reference in New Issue
Block a user