mirror of https://github.com/vuejs/core.git
wip: skip hydration for empty forwarded slots
This commit is contained in:
parent
1b0818bcde
commit
8d4f178dcc
|
@ -136,7 +136,7 @@ export function createSlot(
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
fragment =
|
fragment =
|
||||||
(isHydrating || __DEV__) && !i
|
isHydrating || __DEV__
|
||||||
? new DynamicFragment(SLOT_ANCHOR_LABEL)
|
? new DynamicFragment(SLOT_ANCHOR_LABEL)
|
||||||
: new DynamicFragment()
|
: new DynamicFragment()
|
||||||
const isDynamicName = isFunction(name)
|
const isDynamicName = isFunction(name)
|
||||||
|
|
|
@ -139,7 +139,17 @@ export class DynamicFragment extends VaporFragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
setActiveSub(prevSub)
|
setActiveSub(prevSub)
|
||||||
|
|
||||||
if (isHydrating && this.anchorLabel) {
|
if (isHydrating && this.anchorLabel) {
|
||||||
|
// skip hydration for empty forwarded slots because
|
||||||
|
// the server output does not include their anchors
|
||||||
|
if (
|
||||||
|
this.nodes instanceof DynamicFragment &&
|
||||||
|
this.nodes.forwarded &&
|
||||||
|
!isValidBlock(this.nodes)
|
||||||
|
) {
|
||||||
|
return
|
||||||
|
}
|
||||||
this.hydrate(this.anchorLabel)
|
this.hydrate(this.anchorLabel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue