wip(hydration): hydrate multi-element static nodes
This commit is contained in:
@@ -117,7 +117,18 @@ export function createHydrationFunctions(
|
||||
if (domType !== DOMNodeTypes.ELEMENT) {
|
||||
return onMismatch()
|
||||
}
|
||||
return nextSibling(node)
|
||||
// determine anchor, adopt content
|
||||
let content = ''
|
||||
let cur = node
|
||||
for (let i = 0; i < vnode.staticCount; i++) {
|
||||
content += (cur as Element).outerHTML
|
||||
if (i === vnode.staticCount - 1) {
|
||||
vnode.anchor = cur
|
||||
}
|
||||
cur = nextSibling(cur)!
|
||||
}
|
||||
vnode.children = content
|
||||
return cur
|
||||
case Fragment:
|
||||
if (!isFragmentStart) {
|
||||
return onMismatch()
|
||||
|
||||
Reference in New Issue
Block a user