@@ -12,7 +12,8 @@ import {
12
12
EMPTY_OBJ ,
13
13
ShapeFlags ,
14
14
extend ,
15
- def
15
+ def ,
16
+ SlotFlags
16
17
} from '@vue/shared'
17
18
import { warn } from './warning'
18
19
import { isKeepAlive } from './components/KeepAlive'
@@ -27,24 +28,25 @@ export type InternalSlots = {
27
28
28
29
export type Slots = Readonly < InternalSlots >
29
30
30
- export const enum CompiledSlotTypes {
31
- STATIC = 1 ,
32
- DYNAMIC = 2
33
- }
34
-
35
31
export type RawSlots = {
36
32
[ name : string ] : unknown
37
33
// manual render fn hint to skip forced children updates
38
34
$stable ?: boolean
39
- // internal, for tracking slot owner instance. This is attached during
40
- // normalizeChildren when the component vnode is created.
35
+ /**
36
+ * for tracking slot owner instance. This is attached during
37
+ * normalizeChildren when the component vnode is created.
38
+ * @internal
39
+ */
41
40
_ctx ?: ComponentInternalInstance | null
42
- // internal, indicates compiler generated slots
43
- // we use a reserved property instead of a vnode patchFlag because the slots
44
- // object may be directly passed down to a child component in a manual
45
- // render function, and the optimization hint need to be on the slot object
46
- // itself to be preserved.
47
- _ ?: CompiledSlotTypes
41
+ /**
42
+ * indicates compiler generated slots
43
+ * we use a reserved property instead of a vnode patchFlag because the slots
44
+ * object may be directly passed down to a child component in a manual
45
+ * render function, and the optimization hint need to be on the slot object
46
+ * itself to be preserved.
47
+ * @internal
48
+ */
49
+ _ ?: SlotFlags
48
50
}
49
51
50
52
const isInternalKey = ( key : string ) => key [ 0 ] === '_' || key === '$stable'
@@ -141,8 +143,8 @@ export const updateSlots = (
141
143
// Parent was HMR updated so slot content may have changed.
142
144
// force update slots and mark instance for hmr as well
143
145
extend ( slots , children as Slots )
144
- } else if ( type === CompiledSlotTypes . STATIC ) {
145
- // compiled AND static .
146
+ } else if ( type === SlotFlags . STABLE ) {
147
+ // compiled AND stable .
146
148
// no need to update, and skip stale slots removal.
147
149
needDeletionCheck = false
148
150
} else {
0 commit comments