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 {
|
||||
fragment =
|
||||
(isHydrating || __DEV__) && !i
|
||||
isHydrating || __DEV__
|
||||
? new DynamicFragment(SLOT_ANCHOR_LABEL)
|
||||
: new DynamicFragment()
|
||||
const isDynamicName = isFunction(name)
|
||||
|
|
|
@ -139,7 +139,17 @@ export class DynamicFragment extends VaporFragment {
|
|||
}
|
||||
|
||||
setActiveSub(prevSub)
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue