import {
advanceHydrationNode,
currentHydrationNode,
- isComment,
isHydrating,
locateHydrationNode,
locateVaporFragmentAnchor,
update(render?: BlockFn, key: any = render): void {
if (key === this.current) {
- if (isHydrating) this.hydrate(this.anchorLabel!)
+ if (isHydrating) this.hydrate(this.anchorLabel!, true)
return
}
this.current = key
}
}
- hydrate(label: string): void {
+ hydrate(label: string, isEmpty: boolean = false): void {
// for `v-if="false"` the node will be an empty comment, use it as the anchor.
// otherwise, find next sibling vapor fragment anchor
- if (label === 'if' && isComment(currentHydrationNode!, '')) {
- this.anchor = currentHydrationNode
+ if (label === 'if' && isEmpty) {
+ this.anchor = locateVaporFragmentAnchor(currentHydrationNode!, '')!
} else {
let anchor = locateVaporFragmentAnchor(currentHydrationNode!, label)!
if (!anchor && (label === 'slot' || label === 'if')) {