mirror of https://github.com/vuejs/core.git
perf: optimize hydration node management in createFor
This commit is contained in:
parent
12d5bb5653
commit
3fc644e22a
|
@ -131,20 +131,17 @@ export const createFor = (
|
|||
|
||||
if (!isMounted) {
|
||||
isMounted = true
|
||||
let prevNodes: Block
|
||||
for (let i = 0; i < newLength; i++) {
|
||||
if (isHydrating && isComponent && i > 0) {
|
||||
setCurrentHydrationNode(
|
||||
findLastChild(newBlocks[i - 1].nodes)!.nextSibling,
|
||||
)
|
||||
setCurrentHydrationNode(findLastChild(prevNodes!)!.nextSibling)
|
||||
}
|
||||
mount(source, i)
|
||||
prevNodes = mount(source, i).nodes
|
||||
}
|
||||
|
||||
if (isHydrating) {
|
||||
if (isComponent) {
|
||||
setCurrentHydrationNode(
|
||||
findLastChild(newBlocks[newLength - 1].nodes)!.nextSibling,
|
||||
)
|
||||
setCurrentHydrationNode(findLastChild(prevNodes!)!.nextSibling)
|
||||
}
|
||||
parentAnchor =
|
||||
newLength === 0
|
||||
|
|
Loading…
Reference in New Issue