File tree 1 file changed +7
-2
lines changed
packages/runtime-core/src
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,10 @@ export const initSlots = (
102
102
) => {
103
103
if ( instance . vnode . shapeFlag & ShapeFlags . SLOTS_CHILDREN ) {
104
104
if ( ( children as RawSlots ) . _ === 1 ) {
105
- instance . slots = children as InternalSlots
105
+ const slots : InternalSlots = ( instance . slots = { } )
106
+ for ( const key in children as RawSlots ) {
107
+ if ( key !== '_' ) slots [ key ] = ( children as Slots ) [ key ]
108
+ }
106
109
} else {
107
110
normalizeObjectSlots ( children as RawSlots , ( instance . slots = { } ) )
108
111
}
@@ -128,7 +131,9 @@ export const updateSlots = (
128
131
if ( __DEV__ && isHmrUpdating ) {
129
132
// Parent was HMR updated so slot content may have changed.
130
133
// force update slots and mark instance for hmr as well
131
- extend ( slots , children as Slots )
134
+ for ( const key in children as RawSlots ) {
135
+ if ( key !== '_' ) slots [ key ] = ( children as Slots ) [ key ]
136
+ }
132
137
} else if (
133
138
// bail on dynamic slots (v-if, v-for, reference of scope variables)
134
139
! ( vnode . patchFlag & PatchFlags . DYNAMIC_SLOTS )
You can’t perform that action at this time.
0 commit comments