File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
packages/runtime-vapor/src Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,6 @@ import type { TransitionHooks } from '@vue/runtime-dom'
13
13
import {
14
14
advanceHydrationNode ,
15
15
currentHydrationNode ,
16
- isComment ,
17
16
isHydrating ,
18
17
locateHydrationNode ,
19
18
locateVaporFragmentAnchor ,
@@ -75,7 +74,7 @@ export class DynamicFragment extends VaporFragment {
75
74
76
75
update ( render ?: BlockFn , key : any = render ) : void {
77
76
if ( key === this . current ) {
78
- if ( isHydrating ) this . hydrate ( this . anchorLabel ! )
77
+ if ( isHydrating ) this . hydrate ( this . anchorLabel ! , true )
79
78
return
80
79
}
81
80
this . current = key
@@ -145,11 +144,11 @@ export class DynamicFragment extends VaporFragment {
145
144
}
146
145
}
147
146
148
- hydrate ( label : string ) : void {
147
+ hydrate ( label : string , isEmpty : boolean = false ) : void {
149
148
// for `v-if="false"` the node will be an empty comment, use it as the anchor.
150
149
// otherwise, find next sibling vapor fragment anchor
151
- if ( label === 'if' && isComment ( currentHydrationNode ! , '' ) ) {
152
- this . anchor = currentHydrationNode
150
+ if ( label === 'if' && isEmpty ) {
151
+ this . anchor = locateVaporFragmentAnchor ( currentHydrationNode ! , '' ) !
153
152
} else {
154
153
let anchor = locateVaporFragmentAnchor ( currentHydrationNode ! , label ) !
155
154
if ( ! anchor && ( label === 'slot' || label === 'if' ) ) {
You can’t perform that action at this time.
0 commit comments