@@ -21,6 +21,7 @@ import { warn } from '@vue/runtime-dom'
21
21
import { currentInstance , isVaporComponent } from './component'
22
22
import type { DynamicSlot } from './componentSlots'
23
23
import { renderEffect } from './renderEffect'
24
+ import { VaporVForFlags } from '../../shared/src/vaporFlags'
24
25
25
26
class ForBlock extends VaporFragment {
26
27
scope : EffectScope | undefined
@@ -64,13 +65,7 @@ export const createFor = (
64
65
index : ShallowRef < number | undefined > ,
65
66
) => Block ,
66
67
getKey ?: ( item : any , key : any , index ?: number ) => any ,
67
- /**
68
- * Whether this v-for is used directly on a component. If true, we can avoid
69
- * creating an extra fragment / scope for each block
70
- */
71
- isComponent = false ,
72
- once ?: boolean ,
73
- canUseFastRemove ?: boolean ,
68
+ flags = 0 ,
74
69
// hydrationNode?: Node,
75
70
) : VaporFragment => {
76
71
let isMounted = false
@@ -80,6 +75,8 @@ export const createFor = (
80
75
const parentAnchor = __DEV__ ? createComment ( 'for' ) : createTextNode ( )
81
76
const frag = new VaporFragment ( oldBlocks )
82
77
const instance = currentInstance !
78
+ const canUseFastRemove = flags & VaporVForFlags . FAST_REMOVE
79
+ const isComponent = flags & VaporVForFlags . IS_COMPONENT
83
80
84
81
if ( __DEV__ && ! instance ) {
85
82
warn ( 'createFor() can only be used inside setup()' )
@@ -354,7 +351,11 @@ export const createFor = (
354
351
doRemove && removeBlock ( nodes , parent ! )
355
352
}
356
353
357
- once ? renderList ( ) : renderEffect ( renderList )
354
+ if ( flags & VaporVForFlags . ONCE ) {
355
+ renderList ( )
356
+ } else {
357
+ renderEffect ( renderList )
358
+ }
358
359
return frag
359
360
}
360
361
0 commit comments