File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
packages/runtime-vapor/src Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1- import { type BlockFn , DynamicFragment } from './block'
1+ import { type Block , type BlockFn , DynamicFragment } from './block'
22import { renderEffect } from './renderEffect'
33
44export function createIf (
@@ -7,12 +7,12 @@ export function createIf(
77 b2 ?: BlockFn ,
88 once ?: boolean ,
99 // hydrationNode?: Node,
10- ) : DynamicFragment {
11- const frag = __DEV__ ? new DynamicFragment ( 'if' ) : new DynamicFragment ( )
10+ ) : Block {
1211 if ( once ) {
13- frag . update ( condition ( ) ? b1 : b2 )
12+ return condition ( ) ? b1 ( ) : b2 ? b2 ( ) : [ ]
1413 } else {
14+ const frag = __DEV__ ? new DynamicFragment ( 'if' ) : new DynamicFragment ( )
1515 renderEffect ( ( ) => frag . update ( condition ( ) ? b1 : b2 ) )
16+ return frag
1617 }
17- return frag
1818}
You can’t perform that action at this time.
0 commit comments