mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-07 09:22:27 +00:00
fix(nuxt): clear island uid before saving into the payload (#30767)
This commit is contained in:
parent
e0c47f9bf3
commit
b78da56dd7
@ -132,10 +132,11 @@ export default defineComponent({
|
||||
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
|
||||
// clear all data-island-uid to avoid conflicts when saving into payloads
|
||||
nuxtApp.payload.data[key].html = ssrHTML.value.replaceAll(new RegExp(`data-island-uid="${ssrHTML.value.match(SSR_UID_RE)?.[1] || ''}"`, 'g'), `data-island-uid=""`)
|
||||
}
|
||||
|
||||
const uid = ref<string>(ssrHTML.value.match(SSR_UID_RE)?.[1] ?? getId())
|
||||
const uid = ref<string>(ssrHTML.value.match(SSR_UID_RE)?.[1] || getId())
|
||||
const availableSlots = computed(() => [...ssrHTML.value.matchAll(SLOTNAME_RE)].map(m => m[1]))
|
||||
const html = computed(() => {
|
||||
const currentSlots = Object.keys(slots)
|
||||
|
Loading…
Reference in New Issue
Block a user