File tree 1 file changed +11
-6
lines changed
packages/runtime-core/src
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -123,13 +123,18 @@ export const updateSlots = (
123
123
let deletionComparisonTarget = EMPTY_OBJ
124
124
if ( vnode . shapeFlag & ShapeFlags . SLOTS_CHILDREN ) {
125
125
if ( ( children as RawSlots ) . _ === 1 ) {
126
- if ( ! ( vnode . patchFlag & PatchFlags . DYNAMIC_SLOTS ) ) {
127
- // compiled AND static. this means we can skip removal of potential
128
- // stale slots
126
+ // compiled slots.
127
+ if (
128
+ // bail on dynamic slots (v-if, v-for, reference of scope variables)
129
+ ! ( vnode . patchFlag & PatchFlags . DYNAMIC_SLOTS ) &&
130
+ // bail on HRM updates
131
+ ! ( __DEV__ && instance . parent && instance . parent . renderUpdated )
132
+ ) {
133
+ // compiled AND static.
134
+ // no need to update, and skip stale slots removal.
129
135
needDeletionCheck = false
130
- }
131
- // HMR force update
132
- if ( __DEV__ && instance . parent && instance . parent . renderUpdated ) {
136
+ } else {
137
+ // compiled but dynamic - update slots, but skip normalization.
133
138
extend ( slots , children as Slots )
134
139
}
135
140
} else {
You can’t perform that action at this time.
0 commit comments