@@ -12,7 +12,8 @@ import {
1212 EMPTY_OBJ ,
1313 ShapeFlags ,
1414 extend ,
15- def
15+ def ,
16+ SlotFlags
1617} from '@vue/shared'
1718import { warn } from './warning'
1819import { isKeepAlive } from './components/KeepAlive'
@@ -27,24 +28,25 @@ export type InternalSlots = {
2728
2829export type Slots = Readonly < InternalSlots >
2930
30- export const enum CompiledSlotTypes {
31- STATIC = 1 ,
32- DYNAMIC = 2
33- }
34-
3531export type RawSlots = {
3632 [ name : string ] : unknown
3733 // manual render fn hint to skip forced children updates
3834 $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+ */
4140 _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
4850}
4951
5052const isInternalKey = ( key : string ) => key [ 0 ] === '_' || key === '$stable'
@@ -141,8 +143,8 @@ export const updateSlots = (
141143 // Parent was HMR updated so slot content may have changed.
142144 // force update slots and mark instance for hmr as well
143145 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 .
146148 // no need to update, and skip stale slots removal.
147149 needDeletionCheck = false
148150 } else {
0 commit comments